/* Mobile Short Screen Fixes */

/* Highlight pulse animation for LINE settings auto-scroll */
@keyframes highlightPulse {

    0%,
    100% {
        background-color: transparent;
        box-shadow: none;
    }

    25%,
    75% {
        background-color: rgba(0, 185, 0, 0.15);
        box-shadow: 0 0 20px rgba(0, 185, 0, 0.3);
    }

    50% {
        background-color: rgba(0, 185, 0, 0.25);
        box-shadow: 0 0 30px rgba(0, 185, 0, 0.5);
    }
}

@media (max-height: 800px) {
    #auth-container {
        align-items: flex-start !important;
        padding-top: 10px !important;
    }

    .pixel-card {
        padding: 16px !important;
    }

    .login-icon {
        font-size: 32px !important;
        margin-bottom: 6px !important;
    }

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

    .login-subtitle {
        font-size: 18px !important;
        margin-bottom: 10px !important;
    }
}

@media (max-height: 700px) {
    #auth-container {
        padding: 8px !important;
    }

    .pixel-card {
        padding: 12px !important;
    }

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

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

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

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

    .pixel-input {
        padding: 8px 10px !important;
        min-height: 38px !important;
        font-size: 16px !important;
    }

    .pixel-btn {
        padding: 8px 12px !important;
        min-height: 38px !important;
        font-size: 16px !important;
    }

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

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

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

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

    .pixel-card {
        padding: 8px !important;
    }

    .login-icon {
        font-size: 22px !important;
        margin-bottom: 2px !important;
    }

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

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

    .pixel-input {
        padding: 5px 8px !important;
        min-height: 32px !important;
        font-size: 14px !important;
    }

    .pixel-btn {
        padding: 5px 10px !important;
        min-height: 32px !important;
        font-size: 14px !important;
    }

    .pixel-label {
        font-size: 12px !important;
        margin-bottom: 1px !important;
    }

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

/* ============================================ */
/* Account Settings Mobile Scroll Fixes        */
/* ============================================ */
@media (max-width: 768px) {
    #content-area {
        height: auto !important;
        min-height: 0 !important;
        -webkit-overflow-scrolling: touch;
        overflow-y: auto !important;
        padding-bottom: 100px !important;
    }

    #view-account {
        height: auto !important;
        overflow: visible !important;
    }

    #view-account .content-card {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    #line-settings-container {
        padding-bottom: 20px;
    }

    #view-account form {
        overflow: visible !important;
    }
}

/* Extra fixes for very small height screens */
@media (max-height: 500px) {
    #content-area {
        padding-bottom: 120px !important;
    }

    #line-settings-container {
        padding: 10px 0 !important;
    }

    #line-settings-container h3 {
        font-size: 18px !important;
        margin-bottom: 10px !important;
    }

    #line-settings-container .p-4 {
        padding: 10px !important;
    }

    .line-add-btn {
        padding: 10px 16px !important;
        font-size: 16px !important;
    }
}

/* ============================================ */
/* Trash Page Mobile RWD Fixes                 */
/* ============================================ */
@media (max-width: 768px) {

    /* Trash header - stack title and button */
    #view-trash .content-card>div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    #view-trash .content-card>div:first-child button {
        width: 100% !important;
    }

    /* Trash item - stack content and buttons vertically */
    .trash-item>div {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .trash-item .flex-1 {
        width: 100% !important;
    }

    /* Trash buttons side by side */
    .trash-item>div>div:last-child {
        width: 100% !important;
        display: flex !important;
        gap: 8px !important;
    }

    .trash-item>div>div:last-child button {
        flex: 1 !important;
        text-align: center !important;
    }

    /* Trash item text */
    .trash-item h4 {
        font-size: 18px !important;
        word-break: break-word !important;
    }

    .trash-item p {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }
}

/* ============================================ */
/* Event Form Mobile RWD Fixes                 */
/* ============================================ */
@media (max-width: 768px) {

    /* Date and time inputs - scoped to view-editor */
    #view-editor input[type="date"],
    #view-editor input[type="time"] {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important;
        padding: 12px !important;
    }

    /* Event form container */
    #view-editor .content-card {
        padding: 12px !important;
        overflow-x: hidden !important;
    }

    /* Grid layout for date/time - stack on mobile */
    #view-editor .grid.grid-cols-2 {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    #view-editor .grid.grid-cols-2>div {
        width: 100% !important;
    }

    /* Form overall width control */
    #view-editor form {
        max-width: 100% !important;
        overflow: hidden !important;
    }

    /* Form inputs full width (exclude checkboxes) */
    #view-editor input:not([type="checkbox"]),
    #view-editor select,
    #view-editor textarea {
        width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important;
    }

    /* Form labels */
    #view-editor .pixel-label {
        font-size: 16px !important;
        margin-bottom: 6px !important;
        display: block !important;
    }

    /* Target selection container */
    #view-editor #selected-targets-container {
        overflow-x: auto !important;
    }
}

/* Extra small screens */
@media (max-width: 400px) {

    /* Trash buttons stack vertically */
    .trash-item>div>div:last-child {
        flex-direction: column !important;
    }

    .trash-item>div>div:last-child button {
        width: 100% !important;
    }

    /* Compact event form */
    #view-editor .content-card {
        padding: 8px !important;
    }

    #view-editor .pixel-label {
        font-size: 14px !important;
    }
}