/* Demo Mode Styles for DDC Demo Server */

/* Demo disabled elements */
.demo-disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.demo-disabled:hover {
    cursor: not-allowed !important;
}

/* Demo notice alert styling */
.demo-notice {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #856404;
}

.demo-notice i {
    margin-right: 8px;
}

/* Protected container card styling */
.container-card.demo-protected {
    opacity: 0.7;
    border-color: #ffc107 !important;
}

.container-card.demo-protected .card-header {
    background-color: rgba(255, 193, 7, 0.1);
}

.container-card.demo-protected .btn {
    pointer-events: none;
    opacity: 0.5;
}

/* Demo badge for protected containers */
.demo-protected-badge {
    background-color: #ffc107;
    color: #000;
    font-size: 0.75em;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 8px;
}

/* Input fields in demo mode */
input.demo-disabled,
select.demo-disabled,
textarea.demo-disabled {
    background-color: #e9ecef !important;
}

/* Buttons in demo mode */
button.demo-disabled,
.btn.demo-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Demo section disabled - applies to entire sections */
.demo-section-disabled input:not([type="hidden"]),
.demo-section-disabled select,
.demo-section-disabled textarea,
.demo-section-disabled .btn:not(.btn-close):not(.demo-pulse-btn) {
    opacity: 0.6 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

/* Exception: Demo pulse buttons remain clickable */
.demo-section-disabled .demo-pulse-btn {
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.demo-section-disabled input:not([type="hidden"]),
.demo-section-disabled select,
.demo-section-disabled textarea {
    background-color: #3a3f44 !important;
}

/* Protected row styling */
.demo-protected-row {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

/* Handwritten note style for demo highlights */
.demo-handwritten-note {
    font-family: 'Comic Sans MS', 'Chalkboard', 'Bradley Hand', cursive;
    font-size: 0.9em;
    color: #ffc107;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    transform: rotate(-5deg);
    display: inline-block;
    margin-right: 8px;
    animation: noteWiggle 2s ease-in-out infinite;
}

@keyframes noteWiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(-3deg); }
}

/* Demo Discord Button */
.demo-discord-btn {
    transition: all 0.3s ease;
}

.demo-discord-btn:hover {
    background-color: #4752C4 !important;
    border-color: #4752C4 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5) !important;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

@media (max-width: 768px) {
    /* Mech container - stack vertically on mobile */
    .donator-mech-container {
        flex-direction: column !important;
        align-items: center !important;
    }

    .mech-section {
        margin-bottom: 5px;
    }

    .gauge-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 10px;
    }

    /* Bar labels - make text smaller and wrap */
    .bar-label {
        font-size: 10px !important;
        min-width: 80px !important;
        max-width: 100px !important;
    }

    #nextEvolutionName,
    #nextEvolutionAmount {
        font-size: 9px !important;
        word-break: break-word;
    }

    /* Tables - make scrollable horizontally */
    #status-channels-table,
    #control-channels-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Table wrapper for better scrolling */
    .table-responsive-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -15px;
        padding: 0 15px;
    }

    /* Make table cells smaller on mobile */
    #status-channels-table th,
    #status-channels-table td,
    #control-channels-table th,
    #control-channels-table td {
        padding: 0.3rem !important;
        font-size: 11px !important;
    }

    /* Log buttons - wrap on mobile */
    .log-buttons,
    .btn-group-log,
    #logButtonGroup,
    .d-flex.align-items-center {
        flex-wrap: wrap !important;
        gap: 5px !important;
    }

    /* Specifically target log section buttons */
    #refreshLogsBtn,
    #downloadLogsBtn,
    #clearLogsBtn,
    #clearActionLogBtn {
        margin: 2px !important;
        flex-shrink: 0;
    }

    /* Auto refresh toggle on mobile */
    .form-check.form-switch.me-3 {
        margin-right: 0 !important;
        margin-bottom: 5px;
        width: 100%;
    }

    /* Card padding reduction on mobile */
    .card {
        padding: 10px !important;
    }

    .card-body {
        padding: 10px !important;
    }

    /* Form controls smaller on mobile */
    .form-control-sm {
        font-size: 12px !important;
    }

    /* Buttons in flex containers should wrap */
    .d-flex.justify-content-between {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Demo handwritten note - smaller on mobile, stays with button */
    .demo-handwritten-note {
        font-size: 0.75em;
        margin-right: 5px;
    }

    /* Donation buttons spacing on mobile */
    .donation-section .d-inline-block {
        display: block !important;
        margin: 8px 0 !important;
    }

    /* Keep works! note and Admin Users button together */
    .d-flex.align-items-center:has(.demo-pulse-btn) {
        flex-wrap: nowrap !important;
        flex-shrink: 0;
    }
}

/* Extra small devices (phones, 576px and down) */
@media (max-width: 576px) {
    /* Even more compact on very small screens */
    .bar-label {
        font-size: 9px !important;
        min-width: 70px !important;
        max-width: 120px !important;
    }

    #nextEvolutionName {
        font-size: 8px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100px;
    }

    #nextEvolutionAmount {
        font-size: 9px !important;
    }

    /* Keep mech centered properly with minimal gap */
    .mech-section {
        margin-bottom: 3px;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .mech-display {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Stack action buttons vertically */
    .action-buttons,
    .d-flex.gap-2 {
        flex-direction: column !important;
    }

    /* Full width buttons on very small screens */
    .btn-sm {
        width: 100%;
        margin-bottom: 5px;
    }

    /* Smaller headings */
    h4, h5 {
        font-size: 1rem !important;
    }

    /* Table even more compact */
    #status-channels-table th,
    #status-channels-table td,
    #control-channels-table th,
    #control-channels-table td {
        padding: 0.2rem !important;
        font-size: 10px !important;
    }

    /* Hide less important columns on very small screens */
    .hide-mobile {
        display: none !important;
    }
}
