/*=================================
  Cost Calculator Modern Design
  تراث عسير - Aseer Heritage System
==================================*/

/* ===== Page Header ===== */
.cost-calc-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    padding: 3rem 0 4rem;
    margin-top: 80px;
    margin-bottom: -2rem;
    position: relative;
    overflow: hidden;
}

.cost-calc-header .hero-background-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.cost-calc-header .hero-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(97, 116, 96, 0.95) 0%, rgba(68, 79, 49, 0.95) 100%);
    z-index: 1;
}

.cost-calc-header .hero-pattern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(45deg, 
            transparent, 
            transparent 35px, 
            rgba(255, 255, 255, 0.03) 35px, 
            rgba(255, 255, 255, 0.03) 70px);
    z-index: 2;
    animation: patternFloat 20s linear infinite;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 3;
}

.header-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--accent-gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.header-text {
    flex: 1;
}

.page-title {
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    margin: 0;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
}

/* ===== Container ===== */
.cost-calculator-container {
    padding: 3rem 0;
    max-width: 1200px;
}

/* ===== Building Name Card ===== */
.building-name-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 2px solid rgba(97, 116, 96, 0.1);
    transition: all 0.3s ease;
}

.building-name-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12);
}

.building-name-card .card-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #ffffff;
}

.building-name-card .card-content {
    flex: 1;
}

.building-label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.building-name {
    color: var(--primary-green);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

/* ===== Categories Section ===== */
.categories-section {
    margin-bottom: 3rem;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-brown);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.section-title i {
    color: var(--accent-gold);
}

.section-description {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: #ffffff;
    border: 2px solid rgba(97, 116, 96, 0.15);
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-gold) 0%, var(--primary-green) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-green);
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card.active {
    border-color: var(--accent-gold);
    background: linear-gradient(135deg, rgba(97, 116, 96, 0.05) 0%, rgba(222, 155, 84, 0.05) 100%);
    box-shadow: 0 10px 30px rgba(222, 155, 84, 0.2);
}

.category-card.active::before {
    transform: scaleX(1);
}

.category-card.active .check-badge {
    opacity: 1;
    transform: scale(1);
}

.category-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(97, 116, 96, 0.1) 0%, rgba(222, 155, 84, 0.1) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary-green);
    transition: all 0.3s ease;
}

.category-card:hover .category-icon,
.category-card.active .category-icon {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #d4932f 100%);
    color: #ffffff;
    transform: scale(1.1);
}

.category-info {
    flex: 1;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-brown);
    margin-bottom: 0.25rem;
}

.items-count {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.check-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 30px;
    height: 30px;
    background: var(--accent-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.9rem;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

/* ===== Fields Container ===== */
.fields-container {
    margin-bottom: 2rem;
}

.category-fields-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 2px solid rgba(97, 116, 96, 0.1);
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(97, 116, 96, 0.1);
}

.category-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-title-wrapper i {
    color: var(--accent-gold);
    font-size: 1.5rem;
}

.category-title {
    color: var(--primary-brown);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.fields-count {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.fields-table-wrapper {
    overflow-x: auto;
}

.fields-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.fields-table thead tr {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
}

.fields-table th {
    color: #ffffff;
    padding: 1rem;
    text-align: right;
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
}

.fields-table th:first-child {
    border-top-right-radius: 10px;
}

.fields-table th:last-child {
    border-top-left-radius: 10px;
}

.fields-table th i {
    margin-left: 0.5rem;
    opacity: 0.8;
}

.fields-table tbody tr {
    transition: all 0.3s ease;
}

.fields-table tbody tr:hover {
    background: rgba(97, 116, 96, 0.05);
}

.fields-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(97, 116, 96, 0.1);
}

.item-name {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 1rem;
}

.item-input {
    width: 200px;
}

.quantity-input {
    padding: 0.75rem 1rem;
    border: 2px solid rgba(97, 116, 96, 0.2);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.quantity-input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(222, 155, 84, 0.1);
}

.unit-badge {
    background: rgba(97, 116, 96, 0.1);
    color: var(--primary-green);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== Calculate Button ===== */
.calculate-section {
    text-align: center;
    padding: 2rem 0;
}

.btn-calculate {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #d4932f 100%);
    color: #ffffff;
    border: none;
    padding: 1.25rem 3rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(222, 155, 84, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-calculate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.btn-calculate:hover::before {
    left: 100%;
}

.btn-calculate:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(222, 155, 84, 0.6);
}

.btn-icon {
    font-size: 1.5rem;
    transition: transform 0.4s;
}

.btn-calculate:hover .btn-icon {
    transform: scale(1.2);
}

.btn-arrow {
    transition: transform 0.4s;
}

.btn-calculate:hover .btn-arrow {
    transform: translateX(-5px);
}

[dir="ltr"] .btn-calculate:hover .btn-arrow {
    transform: translateX(5px);
}

/* ===== Responsive Design ===== */
@media (max-width: 992px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .building-name-card {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .cost-calc-header {
        padding: 2rem 0 3rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .category-fields-card {
        padding: 1.5rem;
    }
    
    .fields-table th,
    .fields-table td {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .btn-calculate {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
}

/* ===== Animations ===== */
@keyframes patternFloat {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 100px 100px;
    }
}
