/* General Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #121212; /* Dark background */
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
}

body.light-mode {
    background-color: #f0f0f0;
    color: #333;
}

.container {
    width: 90%;
    max-width: 500px;
    background: #1e1e1e;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s;
}

body.light-mode .container {
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Header */
header {
    position: relative;
    margin-bottom: 30px; /* Adjusted for tabs */
}

header h1 {
    margin: 0 0 10px;
    font-size: 2.5rem;
    font-weight: 700;
    color: #4CAF50; /* A vibrant green */
}

header p {
    margin: 0 0 30px;
    font-size: 1.1rem;
    color: #aaa;
}

body.light-mode header p {
    color: #666;
}

.theme-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ffffff;
}

body.light-mode .theme-btn {
    color: #333;
}

/* Tabs */
#tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #333;
    width: 100%;
}

body.light-mode #tabs {
    border-bottom: 1px solid #ccc;
}

.tab-button {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 1.1rem;
    cursor: pointer;
    color: #aaa;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

body.light-mode .tab-button {
    color: #666;
}

.tab-button:hover:not(.active) {
    color: #4CAF50;
}

body.light-mode .tab-button:hover:not(.active) {
    color: #388E3C;
}

.tab-button.active {
    color: #4CAF50;
    border-bottom: 3px solid #4CAF50;
    font-weight: bold;
}

body.light-mode .tab-button.active {
    color: #388E3C;
    border-bottom: 3px solid #388E3C;
}

/* Tab Content */
.tab-content {
    display: none;
    width: 100%;
    padding-top: 20px;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    font-size: 2rem;
    color: #4CAF50;
    margin-bottom: 15px;
    text-align: center;
}

body.light-mode .tab-content h2 {
    color: #388E3C;
}

/* Menu Selector Specific Styles */
#menu-selector {
    margin-bottom: 30px; /* Space above generate button */
}

.menu-display {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    min-height: 60px;
    font-size: 2rem;
    font-weight: bold;
    color: #4CAF50;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

body.light-mode .menu-display {
    color: #388E3C;
}

.menu-item {
    padding: 10px 20px;
    border-radius: 10px;
    background: linear-gradient(145deg, #4CAF50, #45a049);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 -3px 5px rgba(0,0,0,0.4);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
    white-space: nowrap;
}

body.light-mode .menu-item {
    background: linear-gradient(145deg, #8BC34A, #689F38);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1), inset 0 -3px 5px rgba(255,255,255,0.4);
}

.generate-btn {
    background: linear-gradient(145deg, #4CAF50, #45a049);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

.generate-btn:active {
    transform: translateY(1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* Contact Form Specific Styles */
#tab-content-contact p {
    color: #aaa;
    margin-bottom: 30px;
}

body.light-mode #tab-content-contact p {
    color: #666;
}

#tab-content-contact form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

#tab-content-contact .form-group {
    display: flex;
    flex-direction: column;
}

#tab-content-contact .form-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #eee;
}

body.light-mode #tab-content-contact .form-group label {
    color: #333;
}

#tab-content-contact .form-group input,
#tab-content-contact .form-group textarea {
    padding: 10px;
    border: 1px solid #555;
    border-radius: 5px;
    background-color: #333;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s, background-color 0.3s;
}

body.light-mode #tab-content-contact .form-group input,
body.light-mode #tab-content-contact .form-group textarea {
    border: 1px solid #ccc;
    background-color: #fff;
    color: #333;
}

#tab-content-contact .form-group input:focus,
#tab-content-contact .form-group textarea:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.5);
}

.submit-btn {
    background: linear-gradient(145deg, #4CAF50, #45a049);
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    align-self: center;
    margin-top: 20px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

.submit-btn:active {
    transform: translateY(0px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* Teachable Machine Specific Styles */
#tab-content-teachable-machine p {
    color: #aaa;
    margin-bottom: 30px;
}

body.light-mode #tab-content-teachable-machine p {
    color: #666;
}

#tab-content-teachable-machine button {
    background: linear-gradient(145deg, #4CAF50, #45a049);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#tab-content-teachable-machine button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

#tab-content-teachable-machine button:active {
    transform: translateY(1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

#webcam-container canvas {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    margin-top: 20px;
}

#label-container div {
    margin-top: 5px;
    font-size: 1.1rem;
    color: #4CAF50;
    font-weight: bold;
}

body.light-mode #label-container div {
    color: #388E3C;
}

#result-display {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #333;
    width: 100%;
}

body.light-mode #result-display {
    border-top: 1px solid #ccc;
}

#result-display p {
    font-size: 1.3rem;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 15px;
}

body.light-mode #result-display p {
    color: #388E3C;
}

#gender-prediction {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 20px;
}

body.light-mode #gender-prediction {
    color: #333;
}

#generic-image-display img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    margin-top: 10px;
}


/* Footer */
footer {
    margin-top: 30px;
    font-size: 0.9rem;
    color: #666;
}

body.light-mode footer {
    color: #999;
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 1rem;
    }

    .tab-button {
        font-size: 0.9rem;
        padding: 8px 10px;
    }

    .tab-content h2 {
        font-size: 1.8rem;
    }

    .generate-btn,
    #tab-content-teachable-machine button,
    .submit-btn {
        padding: 12px 25px;
        font-size: 1.1rem;
    }

    #contact-form-section .form-group input,
    #contact-form-section .form-group textarea {
        font-size: 0.9rem;
    }
}
