/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #3949AB;
    margin-bottom: 5px;
}

.logo h1 i {
    margin-right: 10px;
}

.subtitle {
    font-size: 1rem;
    color: #666;
    font-weight: 400;
}

.demo-badge {
    background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.demo-badge i {
    margin-right: 8px;
}

/* Main Content */
.main-content {
    display: grid;
    gap: 30px;
}

/* Calculator Card */
.calculator-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-header {
    text-align: center;
    margin-bottom: 40px;
}

.card-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #2D3748;
    margin-bottom: 10px;
}

.card-header h2 i {
    margin-right: 12px;
    color: #3949AB;
}

.card-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Window Types */
.window-types {
    margin-bottom: 30px;
}

.window-types h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2D3748;
    margin-bottom: 20px;
}

.window-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.window-type-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.window-type-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.window-type-card:hover::before {
    left: 100%;
}

.window-type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.window-type-card.active {
    border-color: #3949AB;
    background: linear-gradient(135deg, #3949AB10, #5C6BC010);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(57, 73, 171, 0.2);
}

.icon-container {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.track-2 {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
}

.track-3 {
    background: linear-gradient(135deg, #EC4899, #DB2777);
}

.track-2plus1 {
    background: linear-gradient(135deg, #10B981, #059669);
}

.window-type-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2D3748;
    margin-bottom: 8px;
}

.window-type-card p {
    font-size: 0.9rem;
    color: #666;
}

/* Unit Toggle */
.unit-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    gap: 15px;
}

.unit-label {
    font-weight: 600;
    color: #2D3748;
}

.toggle-switch {
    position: relative;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    display: block;
    width: 60px;
    height: 30px;
    background: #e2e8f0;
    border-radius: 15px;
    cursor: pointer;
    transition: background 0.3s;
    position: relative;
}

.toggle-switch-handle {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-label {
    background: #3949AB;
}

.toggle-switch input:checked + .toggle-label .toggle-switch-handle {
    transform: translateX(30px);
}

.unit-text {
    font-weight: 600;
    color: #3949AB;
}

/* Input Grid */
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    color: #2D3748;
    margin-bottom: 8px;
    font-size: 1rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 80px 16px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #3949AB;
    background: white;
    box-shadow: 0 0 0 3px rgba(57, 73, 171, 0.1);
}

.unit-display {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    background: linear-gradient(135deg, #3949AB, #5C6BC0);
    color: white;
    border: none;
    padding: 18px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 15px rgba(57, 73, 171, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(57, 73, 171, 0.4);
}

.calculate-btn:active {
    transform: translateY(0);
}

.calculate-btn i {
    margin-right: 10px;
}

/* Results Section */
.results-section {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.results-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2D3748;
}

.results-header h3 i {
    color: #10B981;
    margin-right: 10px;
}

.clear-btn {
    background: #ef4444;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Results Grid */
.results-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 30px;
}

.result-item {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.result-item:hover {
    background: white;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.result-content {
    flex: 1;
}

.result-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2D3748;
    margin-bottom: 4px;
}

.result-measurement {
    font-size: 1rem;
    font-weight: 700;
    color: #2D3748;
}

.result-quantity {
    background: rgba(0, 0, 0, 0.1);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Component Colors */
.handle-color {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
}

.interlock-color {
    background: linear-gradient(135deg, #10B981, #059669);
}

.barring-color {
    background: linear-gradient(135deg, #F59E0B, #D97706);
}

.top-color {
    background: linear-gradient(135deg, #EF4444, #DC2626);
}

.bottom-color {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
}

.glass-color {
    background: linear-gradient(135deg, #06B6D4, #0891B2);
}

/* Results Footer */
.results-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.input-summary {
    color: #666;
    font-weight: 500;
}

.new-calculation-btn {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.new-calculation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.new-calculation-btn i {
    margin-right: 8px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    color: rgba(255, 255, 255, 0.8);
}

.footer-content p {
    margin-bottom: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .calculator-card,
    .results-card {
        padding: 25px;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .window-type-grid {
        grid-template-columns: 1fr;
    }
    
    .results-footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .card-header h2 {
        font-size: 1.5rem;
    }
    
    .calculator-card,
    .results-card {
        padding: 20px;
    }
}

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

.calculate-btn.loading {
    background: #94a3b8;
}

.calculate-btn.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 10px;
}

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