/* Pixel Art Game Style - Enhanced RWD */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

:root {
    --pixel-primary: #6c5ce7;
    --pixel-secondary: #fd79a8;
    --pixel-accent: #00b894;
    --pixel-warning: #fdcb6e;
    --pixel-danger: #e17055;
    --pixel-bg-dark: #2d3436;
    --pixel-bg-light: #dfe6e9;
    --pixel-bg-card: #ffffff;
    --pixel-text-dark: #2d3436;
    --pixel-text-light: #ffffff;
    --pixel-text-muted: #636e72;
    --pixel-border: 4px solid #2d3436;
    --pixel-shadow: 4px 4px 0 #2d3436;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'VT323', monospace;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.hidden-section {
    display: none !important;
}

/* Animations */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

@keyframes pixelSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Buttons */
.pixel-btn {
    font-family: 'VT323', monospace;
    font-size: 20px;
    padding: 14px 24px;
    border: var(--pixel-border);
    box-shadow: var(--pixel-shadow);
    background: var(--pixel-primary);
    color: var(--pixel-text-light);
    cursor: pointer;
    transition: all 0.1s;
    position: relative;
    white-space: nowrap;
}

.pixel-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #2d3436;
}

.pixel-btn:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

.pixel-btn-secondary {
    background: var(--pixel-secondary);
}

.pixel-btn-success {
    background: var(--pixel-accent);
}

.pixel-btn-google {
    background: #ffffff;
    color: var(--pixel-text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* Inputs */
.pixel-input {
    font-family: 'VT323', monospace;
    font-size: 20px;
    padding: 14px 16px;
    border: var(--pixel-border);
    background: #fff;
    width: 100%;
    outline: none;
}

.pixel-input:focus {
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.4);
}

.pixel-label {
    font-family: 'VT323', monospace;
    font-size: 20px;
    display: block;
    margin-bottom: 8px;
    color: var(--pixel-text-dark);
    font-weight: bold;
}

/* Cards */
.pixel-card {
    background: var(--pixel-bg-card);
    border: var(--pixel-border);
    box-shadow: var(--pixel-shadow);
    padding: 28px;
    position: relative;
    margin: auto 0;
}

.pixel-card::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 2px dashed rgba(108, 92, 231, 0.2);
    pointer-events: none;
}

/* Auth Container - SCROLLABLE */
#auth-container {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
    overflow-y: auto;
}

#auth-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 80px 50px, #fff, transparent);
    background-size: 200px 150px;
    animation: twinkle 3s ease-in-out infinite;
    pointer-events: none;
}

#login-card,
#register-card {
    max-width: 420px;
    width: 100%;
    z-index: 10;
}

/* Login Title - LARGER FONT */
.login-title {
    font-family: 'VT323', monospace;
    font-size: 36px;
    text-align: center;
    margin-bottom: 8px;
    color: var(--pixel-primary);
    line-height: 1.3;
    font-weight: bold;
    letter-spacing: 3px;
}

.login-subtitle {
    font-family: 'VT323', monospace;
    font-size: 28px;
    text-align: center;
    color: var(--pixel-secondary);
    margin-bottom: 24px;
}

.login-icon {
    font-size: 64px;
    text-align: center;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

/* Main App Layout */
#main-app {
    min-height: 100vh;
    background: linear-gradient(180deg, #a29bfe 0%, #6c5ce7 100%);
    display: flex;
    position: relative;
}

/* Sidebar */
#main-app aside {
    width: 220px;
    background: linear-gradient(180deg, #2d3436 0%, #1e272e 100%);
    border-right: var(--pixel-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-avatar {
    width: 48px;
    height: 48px;
    background: var(--pixel-warning);
    border: 3px solid #2d3436;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    color: #2d3436;
    flex-shrink: 0;
}

.nav-btn {
    font-family: 'VT323', monospace;
    font-size: 20px;
    padding: 14px 16px;
    border: 2px solid transparent;
    background: transparent;
    color: #dfe6e9;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    width: 100%;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--pixel-warning);
    color: var(--pixel-warning);
}

.nav-btn.active {
    background: var(--pixel-primary);
    border-color: var(--pixel-secondary);
    color: #fff;
}

/* Main Content */
#main-app main {
    flex: 1;
    margin-left: 220px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#main-app header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: var(--pixel-border);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

#page-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    color: var(--pixel-primary);
}

/* Hamburger Menu */
.hamburger-btn {
    display: none;
    background: var(--pixel-primary);
    border: 3px solid #2d3436;
    color: white;
    padding: 10px 14px;
    font-size: 24px;
    cursor: pointer;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
}

/* Content Cards */
.content-card {
    background: rgba(255, 255, 255, 0.95);
    border: var(--pixel-border);
    box-shadow: var(--pixel-shadow);
}

.content-card h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    padding-bottom: 12px;
    border-bottom: 2px dashed rgba(0, 0, 0, 0.2);
    margin-bottom: 16px;
}

/* Dashboard Grid */
#view-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Modal */
#sys-modal>div {
    border: var(--pixel-border);
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.3);
}

#modal-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
}

/* Loader */
#global-loader {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#global-loader .loader {
    width: 48px;
    height: 48px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pixelSpin 1s steps(8) infinite;
}

#global-loader p {
    font-family: 'VT323', monospace;
    font-size: 24px;
    color: #fff;
    margin-top: 16px;
}

/* ========================================
   RWD - Tablet (768px - 1024px)
   ======================================== */
@media (max-width: 1024px) {
    #view-dashboard {
        grid-template-columns: 1fr;
    }

    #main-app aside {
        width: 200px;
    }

    #main-app main {
        margin-left: 200px;
    }
}

/* ========================================
   RWD - Mobile (< 768px)
   ======================================== */
@media (max-width: 768px) {
    .hamburger-btn {
        display: block;
    }

    #main-app aside {
        transform: translateX(-100%);
        width: 280px;
    }

    #main-app aside.open {
        transform: translateX(0);
        animation: slideIn 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
    }

    #main-app main {
        margin-left: 0;
    }

    #main-app header {
        padding: 12px 16px;
    }

    #page-title {
        font-size: 11px;
    }

    #content-area {
        padding: 16px !important;
    }

    #view-dashboard {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .content-card {
        padding: 16px !important;
        box-shadow: 3px 3px 0 #2d3436;
    }

    .content-card h2 {
        font-size: 10px;
    }

    .pixel-input {
        font-size: 18px;
        padding: 12px 14px;
    }

    .pixel-label {
        font-size: 18px;
    }

    .pixel-btn {
        font-size: 18px;
        padding: 12px 16px;
    }

    .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    .nav-btn {
        font-size: 22px;
        padding: 16px 20px;
    }

    .sidebar-avatar {
        width: 56px;
        height: 56px;
        font-size: 20px;
    }

    #notification-list>div {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    #notification-list .pixel-btn {
        width: 100%;
    }

    #target-selection-list {
        height: 200px !important;
    }

    #login-card,
    #register-card {
        max-width: 100%;
        padding: 20px;
    }

    .pixel-card {
        padding: 20px;
    }

    .login-title {
        font-size: 28px;
    }

    .login-subtitle {
        font-size: 24px;
    }

    .login-icon {
        font-size: 48px;
    }
}

/* ========================================
   RWD - Small Mobile (< 480px)
   ======================================== */
@media (max-width: 480px) {
    #auth-container {
        padding: 12px 8px;
    }

    .pixel-card {
        padding: 16px;
        box-shadow: 3px 3px 0 #2d3436;
    }

    .pixel-card::before {
        top: 5px;
        left: 5px;
        right: 5px;
        bottom: 5px;
    }

    .login-title {
        font-size: 24px;
    }

    .login-subtitle {
        font-size: 20px;
        margin-bottom: 16px;
    }

    .pixel-btn {
        font-size: 16px;
        padding: 10px 14px;
    }

    .pixel-input {
        font-size: 16px;
        padding: 10px 12px;
    }

    #page-title {
        font-size: 10px;
    }

    .content-card h2 {
        font-size: 9px;
    }

    .login-icon {
        font-size: 40px;
        margin-bottom: 12px;
    }
}

/* ========================================
   RWD - Very Short Screens (height < 600px)
   ======================================== */
@media (max-height: 600px) {
    #auth-container {
        align-items: flex-start;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .login-icon {
        font-size: 32px;
        margin-bottom: 8px;
    }

    .login-title {
        font-size: 24px;
        margin-bottom: 4px;
    }

    .login-subtitle {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .pixel-card {
        padding: 16px;
    }

    .pixel-input {
        padding: 10px 12px;
    }

    .pixel-btn {
        padding: 10px 14px;
    }

    .mb-4 {
        margin-bottom: 0.75rem !important;
    }

    .mb-6 {
        margin-bottom: 1rem !important;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--pixel-bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--pixel-primary);
    border: 2px solid #2d3436;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--pixel-secondary);
}

/* Touch-friendly */
@media (pointer: coarse) {

    .nav-btn,
    .pixel-btn {
        min-height: 48px;
    }

    .pixel-input {
        min-height: 48px;
    }
}

/* ========================================
   RWD - Very Short Screens (height < 700px)
   ======================================== */
@media (max-height: 700px) {
    #auth-container {
        align-items: flex-start;
        padding: 8px;
    }

    .pixel-card {
        padding: 12px;
    }

    .pixel-card::before {
        display: none;
    }

    .login-icon {
        font-size: 28px;
        margin-bottom: 4px;
    }

    .login-title {
        font-size: 20px;
        margin-bottom: 2px;
    }

    .login-subtitle {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .pixel-input {
        padding: 8px 10px;
        min-height: 40px;
    }

    .pixel-btn {
        padding: 8px 12px;
        min-height: 40px;
    }

    .pixel-label {
        font-size: 14px;
        margin-bottom: 2px;
    }

    .mb-3,
    .mb-4 {
        margin-bottom: 6px !important;
    }

    .mb-6 {
        margin-bottom: 10px !important;
    }
}

@media (max-height: 600px) {
    #auth-container {
        padding: 4px;
    }

    .pixel-card {
        padding: 8px;
    }

    .login-icon {
        font-size: 24px;
        margin-bottom: 2px;
    }

    .login-title {
        font-size: 18px;
    }

    .login-subtitle {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .pixel-input {
        padding: 6px 8px;
        min-height: 36px;
        font-size: 14px;
    }

    .pixel-btn {
        padding: 6px 10px;
        min-height: 36px;
        font-size: 14px;
    }

    .pixel-label {
        font-size: 12px;
    }

    .mb-3,
    .mb-4,
    .mb-6 {
        margin-bottom: 4px !important;
    }
}

/* ==================================================
   Font Size Improvements for Better Readability
   ================================================== */

/* Modal - Larger title and message */
#sys-modal #modal-title {
    font-size: 20px !important;
    letter-spacing: 0.5px;
}

#sys-modal #modal-message {
    font-size: 28px !important;
    line-height: 1.4;
}

#sys-modal .pixel-btn {
    font-size: 22px !important;
    padding: 12px 24px !important;
}

/* Page title in header */
#page-title {
    font-size: 28px !important;
}

/* Current date in header */
#current-date {
    font-size: 24px !important;
}

/* Content card headings (h2) */
.content-card h2 {
    font-size: 28px !important;
    font-weight: bold;
}

/* Nav buttons in sidebar */
.nav-btn {
    font-size: 20px !important;
}

::-webkit-scrollbar-track {
    background: var(--pixel-bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--pixel-primary);
    border: 2px solid #2d3436;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--pixel-secondary);
}

/* Touch-friendly */
@media (pointer: coarse) {

    .nav-btn,
    .pixel-btn {
        min-height: 48px;
    }

    .pixel-input {
        min-height: 48px;
    }
}

/* ========================================
   RWD - Very Short Screens (height < 700px)
   ======================================== */
@media (max-height: 700px) {
    #auth-container {
        align-items: flex-start;
        padding: 8px;
    }

    .pixel-card {
        padding: 12px;
    }

    .pixel-card::before {
        display: none;
    }

    .login-icon {
        font-size: 28px;
        margin-bottom: 4px;
    }

    .login-title {
        font-size: 20px;
        margin-bottom: 2px;
    }

    .login-subtitle {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .pixel-input {
        padding: 8px 10px;
        min-height: 40px;
    }

    .pixel-btn {
        padding: 8px 12px;
        min-height: 40px;
    }

    .pixel-label {
        font-size: 14px;
        margin-bottom: 2px;
    }

    .mb-3,
    .mb-4 {
        margin-bottom: 6px !important;
    }

    .mb-6 {
        margin-bottom: 10px !important;
    }
}

@media (max-height: 600px) {
    #auth-container {
        padding: 4px;
    }

    .pixel-card {
        padding: 8px;
    }

    .login-icon {
        font-size: 24px;
        margin-bottom: 2px;
    }

    .login-title {
        font-size: 18px;
    }

    .login-subtitle {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .pixel-input {
        padding: 6px 8px;
        min-height: 36px;
        font-size: 14px;
    }

    .pixel-btn {
        padding: 6px 10px;
        min-height: 36px;
        font-size: 14px;
    }

    .pixel-label {
        font-size: 12px;
    }

    .mb-3,
    .mb-4,
    .mb-6 {
        margin-bottom: 4px !important;
    }
}

/* ==================================================
   Font Size Improvements for Better Readability
   ================================================== */

/* Modal - Larger title and message */
#sys-modal #modal-title {
    font-size: 20px !important;
    letter-spacing: 0.5px;
}

#sys-modal #modal-message {
    font-size: 28px !important;
    line-height: 1.4;
}

#sys-modal .pixel-btn {
    font-size: 22px !important;
    padding: 12px 24px !important;
}

/* Page title in header */
#page-title {
    font-size: 28px !important;
}

/* Current date in header */
#current-date {
    font-size: 24px !important;
}

/* Content card headings (h2) */
.content-card h2 {
    font-size: 28px !important;
    font-weight: bold;
}

/* Nav buttons in sidebar */
.nav-btn {
    font-size: 20px !important;
}

/* Calendar month/year display */
#calendar-month-year {
    font-size: 28px !important;
}

/* Form labels */
.pixel-label {
    font-size: 20px !important;
}

/* Event modal title */
#event-modal-title {
    font-size: 28px !important;
}

/* Search modal input */
#search-input {
    font-size: 22px !important;
}

/* ========================================
   Private Event Styles
   ======================================== */

/* Private event badge */
.private-badge {
    background: linear-gradient(135deg, #9b59b622 0%, #9b59b633 100%);
    color: #9b59b6;
    padding: 2px 8px;
    font-size: 14px;
    border: 1px dashed #9b59b6;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Private event in calendar - hover effect */
.calendar-event-bar.private-event {
    transition: all 0.2s ease;
}

.calendar-event-bar.private-event:hover {
    background: linear-gradient(135deg, #9b59b622 0%, #9b59b633 100%) !important;
    transform: scale(1.02);
}

/* Private event card in day view */
.private-event-card {
    border-left: 4px dashed #9b59b6 !important;
    background: linear-gradient(135deg, #f8f4fc 0%, #f3e8ff 100%) !important;
}

/* Subtle lock icon animation */
@keyframes lockPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.private-event .lock-icon {
    animation: lockPulse 2s ease-in-out infinite;
}

/* RWD for private events on mobile */
@media (max-width: 768px) {
    .private-badge {
        font-size: 12px;
        padding: 1px 6px;
    }

    /* Calendar grid - private events text size */
    .calendar-event-bar.private-event {
        font-size: 10px !important;
    }

    /* Day events list - wrap badges properly */
    .private-event-card h4 {
        flex-wrap: wrap;
    }
}

/* RWD for small mobile */
@media (max-width: 480px) {
    .private-badge {
        font-size: 10px;
        padding: 1px 4px;
    }

    .calendar-event-bar.private-event {
        font-size: 9px !important;
    }
}