/* ==================== BASE STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background-color: #121212;
    color: white;
    transition: background-color 0.3s, color 0.3s;
    font-size: 14px;
    line-height: 1.5;
}

/* ==================== NAVBAR CONTAINER ==================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background-color: #1f1f1f;
    border-radius: 8px;
    margin: 8px 8px;
    height: auto;
    flex-wrap: wrap;
    position: relative;
    gap: 8px;
    min-height: 44px;
}

/* ==================== LEFT AND RIGHT GROUPS ==================== */
.navbar-left,
.navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 24px;
}

.navbar-left {
    flex: 1;
    min-width: 100px;
    margin-right: auto;
}

.navbar-right {
    margin-left: auto;
}

/* ==================== LINKS & ICONS ==================== */
.navbar span {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 0;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar i {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    min-width: 24px;
    min-height: 24px;
}

.navbar a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0;
    padding: 6px 8px;
    text-decoration: none;
    color: inherit;
    font-size: 14px;
    transition: all 0.3s ease;
    border-radius: 6px;
    cursor: pointer;
    min-height: 36px;
    min-width: 36px;
}

.navbar a:hover,
.navbar a:focus {
    opacity: 0.85;
    background-color: rgba(255, 255, 255, 0.1);
    outline: none;
}

.navbar-right a {
    color: white;
}

/* ==================== BUTTON STYLES ==================== */
.navbar .btn {
    padding: 8px 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 36px;
    min-width: 36px;
    white-space: nowrap;
}

.navbar .btn-primary {
    background-color: #007bff;
    color: white;
}

.navbar .btn-primary:hover,
.navbar .btn-primary:focus {
    background-color: #0056b3;
    transform: translateY(-1px);
    outline: none;
}

.navbar .btn:focus {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
}

/* ==================== THEME TOGGLE ==================== */
.toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
    background: #444;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
}

.toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: left 0.3s ease;
}

.light-theme {
    background-color: white;
    color: black;
}

.light-theme .navbar {
    background-color: #f0f0f0;
}

.light-theme .navbar-right a {
    color: black;
}

.light-theme .toggle-switch {
    background: #ccc;
}

.light-theme .toggle-knob {
    background: black;
}

.toggle-active .toggle-knob {
    left: 22px;
}

/* ==================== SMALL CIRCLE ICONS ==================== */
.icons {
    background: black;
    color: white;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.light-theme .icons {
    background: #333;
    color: white;
}

/* ==================== EMOJI THEME SWITCH ==================== */
.emoji {
    display: flex;
    align-items: center;
    border: 2px solid rgb(17, 48, 223);
    margin: 2px;
    padding: 2px 6px;
    border-radius: 5px;
    gap: 6px;
    transition: border-color 0.3s ease;
}

/* ==================== DATE SPAN STYLING ==================== */
#current-date {
    font-size: inherit;
    white-space: nowrap;
}

/* ==================== DROPDOWN ==================== */
.files-container {
    position: relative;
    cursor: pointer;
}

.dropdown {
    display: none;
    position: absolute;
    top: 35px;
    left: 0;
    background: #2a2a2a;
    border-radius: 5px;
    min-width: 150px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.dropdown a {
    display: block;
    padding: 8px 12px;
    color: white;
    text-decoration: none;
}

.dropdown a:hover {
    background: #444;
}

.light-theme .dropdown {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.light-theme .dropdown a {
    color: black;
}

.light-theme .dropdown a:hover {
    background: #e9ecef;
}

/* ==================== MOBILE FIRST MEDIA QUERIES ==================== */

/* Mobile Portrait (320px - 575px) */
@media (max-width: 575px) {
    .navbar {
        padding: 8px 10px;
        margin: 8px 8px;
        gap: 8px;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .navbar-left {
        flex: 1 1 auto;
        min-width: auto;
        margin-right: 0;
    }

    .navbar-left span {
        font-size: 13px;
        max-width: 200px;
    }

    .navbar-left i {
        font-size: 16px;
    }

    .navbar-right {
        gap: 6px;
        margin-left: 0;
    }

    .navbar a,
    .navbar .btn {
        font-size: 12px;
        padding: 6px 8px;
        min-width: 34px;
        min-height: 34px;
    }

    .navbar i {
        font-size: 16px;
    }

    .icons,
    #current-date {
        display: none !important;
    }

    .emoji {
        padding: 3px 5px;
        gap: 3px;
        border-width: 1px;
        font-size: 12px;
    }

    .toggle-switch {
        width: 30px;
        height: 16px;
    }

    .toggle-knob {
        width: 11px;
        height: 11px;
        top: 2px;
    }

    .toggle-active .toggle-knob {
        left: 17px;
    }
}

/* Mobile Landscape & Small Tablets (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .navbar {
        padding: 8px 12px;
        margin: 10px 10px;
        gap: 10px;
    }

    .navbar-left span {
        font-size: 14px;
        max-width: 250px;
    }

    .navbar-left i {
        font-size: 18px;
    }

    .navbar-right {
        gap: 8px;
    }

    .navbar a,
    .navbar .btn {
        font-size: 13px;
        padding: 6px 10px;
        min-width: 36px;
        min-height: 36px;
    }

    #current-date {
        display: inline;
        font-size: 12px;
    }

    .icons {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }

    .emoji {
        padding: 3px 6px;
        gap: 4px;
    }

    .toggle-switch {
        width: 32px;
        height: 17px;
    }

    .toggle-knob {
        width: 13px;
        height: 13px;
    }

    .toggle-active .toggle-knob {
        left: 17px;
    }
}

/* Tablets (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .navbar {
        padding: 10px 15px;
        margin: 12px 15px;
        gap: 12px;
    }

    .navbar-left span {
        font-size: 16px;
    }

    .navbar-left i {
        font-size: 20px;
    }

    .navbar-right {
        gap: 10px;
    }

    .navbar a {
        font-size: 14px;
        padding: 6px 12px;
    }

    .navbar .btn {
        font-size: 14px;
        padding: 6px 12px;
    }

    #current-date {
        font-size: 13px;
    }

    .icons {
        width: 23px;
        height: 23px;
        font-size: 13px;
    }

    .emoji {
        padding: 3px 7px;
        gap: 5px;
    }

    .toggle-switch {
        width: 36px;
        height: 19px;
    }

    .toggle-knob {
        width: 15px;
        height: 15px;
    }

    .toggle-active .toggle-knob {
        left: 19px;
    }
}

/* Large Tablets & Small Desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .navbar {
        padding: 10px 18px;
        margin: 15px 15px;
        gap: 15px;
    }

    .navbar-left span {
        font-size: 17px;
    }

    .navbar-left i {
        font-size: 21px;
    }

    .navbar-right {
        gap: 12px;
    }

    .navbar a {
        font-size: 15px;
        padding: 7px 13px;
    }

    .navbar .btn {
        font-size: 15px;
        padding: 7px 13px;
    }

    #current-date {
        font-size: 14px;
    }

    .icons {
        width: 25px;
        height: 25px;
        font-size: 14px;
    }

    .emoji {
        padding: 4px 8px;
        gap: 6px;
    }

    .toggle-switch {
        width: 40px;
        height: 20px;
    }

    .toggle-knob {
        width: 16px;
        height: 16px;
    }

    .toggle-active .toggle-knob {
        left: 22px;
    }
}

/* Desktop (1200px and above) */
@media (min-width: 1200px) {
    .navbar {
        padding: 11px 20px;
        margin: 15px 20px;
        gap: 15px;
    }

    .navbar-left span {
        font-size: 18px;
    }

    .navbar-left i {
        font-size: 22px;
    }

    .navbar-right {
        gap: 14px;
    }

    .navbar a {
        font-size: 16px;
        padding: 8px 14px;
    }

    .navbar .btn {
        font-size: 16px;
        padding: 8px 14px;
    }

    #current-date {
        font-size: 15px;
    }

    .icons {
        width: 26px;
        height: 26px;
        font-size: 15px;
    }

    .emoji {
        padding: 4px 9px;
        gap: 7px;
    }

    .toggle-switch {
        width: 44px;
        height: 22px;
    }

    .toggle-knob {
        width: 18px;
        height: 18px;
    }

    .toggle-active .toggle-knob {
        left: 24px;
    }
}

/* Extra Large Desktop (1400px and above) */
@media (min-width: 1400px) {
    .navbar {
        padding: 12px 25px;
        margin: 20px 25px;
        gap: 18px;
    }

    .navbar-left span {
        font-size: 20px;
    }

    .navbar-left i {
        font-size: 24px;
    }

    .navbar-right {
        gap: 16px;
    }

    .navbar a {
        font-size: 17px;
        padding: 9px 16px;
    }

    .navbar .btn {
        font-size: 17px;
        padding: 9px 16px;
    }

    #current-date {
        font-size: 16px;
    }

    .icons {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .emoji {
        padding: 5px 10px;
        gap: 8px;
    }

    .toggle-switch {
        width: 48px;
        height: 24px;
    }

    .toggle-knob {
        width: 20px;
        height: 20px;
    }

    .toggle-active .toggle-knob {
        left: 26px;
    }
}

/* Hover effects for non-mobile devices */
@media (min-width: 768px) {
    .navbar a:hover {
        transform: translateY(-2px);
    }

    .icons:hover {
        transform: scale(1.1);
    }

    .toggle-switch:hover {
        background: #555;
    }

    .light-theme .toggle-switch:hover {
        background: #bbb;
    }
}

/* Accessibility */
.navbar a:focus,
.navbar .btn:focus,
.toggle-switch:focus {
    outline: 2px solid rgb(17, 48, 223);
    outline-offset: 2px;
}

/* Hidden attribute */
[hidden] {
    display: none !important;
}

/* Print styles */
@media print {
    .navbar {
        background: white !important;
        color: black !important;
        border: 1px solid #ccc;
    }

    .emoji,
    .icons,
    .toggle-switch,
    .btn {
        display: none !important;
    }

    .navbar a {
        color: black !important;
    }
}
