/* Modern Predict Page Styles */

.predict-hero {
    background: var(--gradient-primary);
    padding: 4rem 0;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.predict-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></svg>');
    background-size: 30px 30px;
    animation: float 15s infinite linear;
}

.predict-hero h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.predict-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Predict Interface */
.predict-interface {
    padding: 4rem 0;
    background: var(--bg-light);
}

.predict-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.results-section {
    margin-top: 0;
}

/* Camera Section */
.camera-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.camera-header {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.header-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.dropdown-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.instructions-dropdown,
.alphabet-dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    min-width: 500px;
    max-width: 600px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.dropdown-content.show {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

.instructions-list {
    padding: 1.5rem;
}

.instruction-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.instruction-item:last-child {
    margin-bottom: 0;
}

.instruction-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.instruction-item strong {
    display: block;
    color: var(--text);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.instruction-item p {
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

.alphabet-content {
    padding: 1.5rem;
    text-align: center;
}

.alphabet-chart-dropdown {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hand-tip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #93c5fd;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.tip-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.tip-text {
    font-weight: 500;
}

.camera-container {
    position: relative;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
}

#webcam {
    width: 100%;
    height: auto;
    display: block;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.detection-zone {
    position: absolute;
    top: 50%;
    left: 25%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 3px dashed var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1rem;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: var(--primary); opacity: 1; }
    50% { border-color: var(--secondary); opacity: 0.7; }
}

.zone-label {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* Results Section */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 3rem;
}

.prediction-card,
.word-builder-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.prediction-card::before,
.word-builder-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
}

.prediction-card h2,
.word-builder-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Prediction Display */
.prediction-display {
    text-align: center;
    margin-bottom: 1rem;
}

.prediction-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    background: var(--bg-light);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
    border: 2px solid var(--border);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.prediction-letter.no-hand {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-light);
    text-align: center;
    padding: 0.5rem;
    line-height: 1.2;
}

.prediction-letter.hidden {
    opacity: 0.3;
    transform: scale(0.9);
}

.confidence-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.confidence-fill {
    height: 100%;
    background: var(--gradient-secondary);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Word Builder */
.word-display {
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.word-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: var(--transition);
}

.word-display:hover::before {
    transform: scaleX(1);
}

.current-word {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    font-family: 'Inter', monospace;
    letter-spacing: 2px;
    word-break: break-all;
}

.word-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Control Buttons */
.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    box-shadow: var(--shadow);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

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

.control-btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.control-btn.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.control-btn.danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-icon {
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .predict-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .results-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .predict-hero {
        padding: 3rem 0;
    }
    
    .predict-hero h1 {
        font-size: 2.5rem;
    }
    
    .predict-hero p {
        font-size: 1.1rem;
        padding: 0 1rem;
    }
    
    .predict-interface {
        padding: 3rem 0;
    }
    
    .predict-grid {
        padding: 0 1rem;
    }
    
    .camera-section {
        padding: 1.5rem;
    }
    
    .header-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .dropdown-content {
        min-width: 280px;
        max-width: calc(100vw - 20px);
        left: 10px;
        right: 10px;
        top: 10px;
        margin: 0;
    }
    
    .results-section {
        grid-template-columns: 1fr;
    }
    
    .prediction-letter {
        width: 70px;
        height: 70px;
        font-size: 2.5rem;
    }
    
    .prediction-letter.no-hand {
        width: 70px;
        height: 70px;
        font-size: 0.65rem;
    }
    
    .detection-zone {
        width: 150px;
        height: 150px;
        left: 25%;
    }
}

@media (max-width: 480px) {
    .predict-hero h1 {
        font-size: 2rem;
    }
    
    .predict-hero p {
        font-size: 1rem;
    }
    
    .camera-section {
        padding: 1rem;
    }
    
    .prediction-card,
    .word-builder-card {
        padding: 1.5rem;
    }
    
    .prediction-letter {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .prediction-letter.no-hand {
        width: 60px;
        height: 60px;
        font-size: 0.6rem;
    }
    
    .current-word {
        font-size: 1.25rem;
        letter-spacing: 1px;
    }
    
    .word-controls {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .detection-zone {
        width: 120px;
        height: 120px;
        left: 25%;
    }
}