/* Scope 1 Emissions Specific Styles */

/* Page Actions in Hero */
.page-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

/* Main Layout */
.scope1-main {
    background-color: var(--light-bg);
    padding: 30px 0;
    min-height: 60vh;
}

.scope1-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 25px;
    align-items: start;
}

/* Scope 1 Sidebar */
.scope1-sidebar {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 85px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 25px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section h3 {
    color: var(--primary-dark);
    margin-bottom: 12px;
    font-size: 1rem;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 6px;
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--light-bg);
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
    font-size: 0.9rem;
    position: relative;
}

.category-item:hover {
    background: rgba(230, 126, 34, 0.1);
    border-color: var(--primary-light);
}

.category-item.active {
    background: rgba(230, 126, 34, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-dark);
    font-weight: 500;
}

.category-item i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
    flex-shrink: 0;
    font-size: 1.1rem;
}

.emission-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: auto;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    background: var(--light-bg);
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    width: 100%;
}

.action-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-1px);
}

.total-emissions {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 8px;
    color: white;
}

.total-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.total-label {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.total-change {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
}

.total-change.positive {
    color: #2ecc71;
}

.total-change.negative {
    color: #e74c3c;
}

/* Scope 1 Content */
.scope1-content {
    background: var(--white);
    border-radius: 8px;
    padding: 25px;
    box-shadow: var(--shadow);
    min-height: 500px;
    overflow: visible;
}

/* Emission Categories */
.emission-category {
    display: none;
}

.emission-category.active {
    display: block;
}

.category-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light-bg);
}

.category-header h2 {
    color: var(--primary-dark);
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-header h2 i {
    color: var(--primary-color);
}

.category-header p {
    color: var(--secondary-color);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.category-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.stat {
    text-align: center;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 35px;
    padding: 25px;
    background: var(--light-bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.form-section h3 {
    color: var(--primary-dark);
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 2px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--secondary-color);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 0.8rem;
    line-height: 1.3;
}

/* Save Actions */
.save-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--light-bg);
    flex-wrap: wrap;
}

/* Button Styles */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: rgba(230, 126, 34, 0.1);
    transform: translateY(-2px);
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .category-stats {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 968px) {
    .scope1-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .scope1-sidebar {
        position: static;
        margin-bottom: 0;
        max-height: none;
    }
    
    .category-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .category-item {
        flex: 1;
        min-width: 150px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .emission-badge {
        margin-left: 0;
    }
    
    .quick-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .action-btn {
        flex: 1;
        min-width: 120px;
    }
    
    .save-actions {
        justify-content: center;
    }
}

@media screen and (max-width: 768px) {
    .category-nav {
        flex-direction: column;
    }
    
    .category-item {
        flex-direction: row;
        text-align: left;
    }
    
    .emission-badge {
        margin-left: auto;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .save-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero {
        padding: 30px 15px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .page-actions {
        flex-direction: column;
    }
}

@media screen and (max-width: 480px) {
    .scope1-content {
        padding: 15px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .category-header h2 {
        font-size: 1.4rem;
    }
    
    .form-section h3 {
        font-size: 1.1rem;
    }
}

/* Prevent horizontal overflow */
body {
    overflow-x: hidden;
}

.container, .nav-container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Form validation styles */
.form-control:invalid {
    border-color: #e74c3c;
}

.form-control:valid {
    border-color: #2ecc71;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}