* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    color: #fff;
    min-height: 100vh;
    padding: 20px;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}
h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #ffcc00;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
.subtitle {
    font-size: 1.2rem;
    color: #ffcc00;
    margin-bottom: 20px;
}
.main-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}
.video-section {
    flex: 1;
    min-width: 300px;
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}
.info-section {
    flex: 1;
    min-width: 300px;
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}
#video-container {
    position: relative;
    width: 100%;
    height: 400px;
    border: 3px solid #ffcc00;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}
#video {
    width: 100%;
    height: 100%;
    background-color: #000;
    transform: scaleX(-1);
}
#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(-1);
}
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}
button {
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(145deg, #ff6b6b, #ff8e53);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}
button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
    background: linear-gradient(145deg, #ff8e53, #ff6b6b);
}
#speak-btn {
    background: linear-gradient(145deg, #4ecdc4, #44a08d);
}
#clear-btn {
    background: linear-gradient(145deg, #ff9a9e, #fad0c4);
}
#help-btn {
    background: linear-gradient(145deg, #a18cd1, #fbc2eb);
}
.output-section {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}
#text-output {
    font-size: 1.8rem;
    padding: 20px;
    border: 2px solid #4ecdc4;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    min-height: 80px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}
#status {
    text-align: center;
    font-style: italic;
    color: #ffcc00;
    margin-bottom: 20px;
}
.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
    margin-top: 20px;
}
.letter {
    padding: 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s;
}
.letter:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}
.detected {
    background: linear-gradient(145deg, #4ecdc4, #44a08d);
    color: white;
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.5);
}
.instructions {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}
.instructions h3 {
    color: #ffcc00;
    margin-bottom: 15px;
}
.instructions ol {
    padding-left: 20px;
    line-height: 1.6;
}
.instructions li {
    margin-bottom: 10px;
}
footer {
    text-align: center;
    margin-top: 40px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}
.sign-language-reference {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}
.sign-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}
.sign-letter {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffcc00;
    margin-bottom: 5px;
}
.sign-description {
    font-size: 0.8rem;
    color: #ccc;
}
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    border-radius: 10px;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #4ecdc4;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    #video-container {
        height: 300px;
    }
}