/* === MiaCat Unified Design System === */

/* CSS Variables for consistent theming */
:root {
    /* Colors - Professional Staff Portal Theme */
    --color-primary: #7ecfff;
    --color-primary-dark: #5bbbe0;
    --color-secondary: #4a148c;
    --color-secondary-dark: #6a1b9a;
    
    /* Semantic Colors */
    --color-success: #66bb6a;
    --color-warning: #ffa726;
    --color-error: #ef5350;
    --color-info: #42a5f5;
    
    /* Background Colors */
    --bg-primary: #181c24;
    --bg-secondary: #23283a;
    --bg-tertiary: #2c3244;
    --bg-accent: #202735;
    
    /* Text Colors */
    --text-primary: #e0e6ef;
    --text-secondary: #bec4cf;
    --text-muted: #888;
    
    /* Legacy aliases for backward compatibility */
    --accent-primary: var(--color-primary);
    --accent-secondary: var(--color-primary-dark);
    --accent-purple: var(--color-secondary);
    --accent-purple-hover: var(--color-secondary-dark);
    --success: var(--color-success);
    --warning: var(--color-warning);
    --error: var(--color-error);
    --border-color: #4a5368;
    --shadow: rgba(0,0,0,0.18);
    --shadow-light: rgba(0,0,0,0.08);
    --shadow-heavy: rgba(0,0,0,0.25);
    
    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-xxl: 3rem;
    
    /* Legacy spacing aliases */
    --spacing-xs: var(--space-xs);
    --spacing-sm: var(--space-sm);
    --spacing-md: var(--space-md);
    --spacing-lg: var(--space-lg);
    --spacing-xl: var(--space-xl);
    --spacing-xxl: var(--space-xxl);
    
    /* Typography */
    --font-family-primary: 'Inter', 'Segoe UI', sans-serif;
    --font-family-mono: 'Fira Code', 'Consolas', monospace;
    --font-primary: var(--font-family-primary);
    --font-mono: var(--font-family-mono);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.18);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.25);
}

/* Reset and base styles */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    line-height: 1.6;
    font-size: 16px;
}

/* Layout containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--bg-tertiary);
    box-shadow: 0 8px 32px var(--shadow);
    margin-top: 100px;
    margin-bottom: var(--spacing-xl);
    width: 95%;
}

.box, .card, .panel, .section, .modal-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-tertiary);
    box-shadow: 0 4px 16px var(--shadow);
    padding: var(--spacing-lg);
}

/* Typography */
h1, h2, h3, h4, h5, h6, .title {
    color: var(--accent-primary);
    font-weight: 600;
    letter-spacing: -0.025em;
    margin: 0 0 var(--spacing-lg) 0;
    text-align: center;
}

h1, .title.is-1 { font-size: 2.5rem; }
h2, .title.is-2 { font-size: 2rem; }
h3, .title.is-3 { font-size: 1.75rem; }
h4, .title.is-4 { font-size: 1.5rem; }
h5, .title.is-5 { font-size: 1.25rem; }
h6, .title.is-6 { font-size: 1rem; }

.subtitle {
    color: var(--text-secondary);
    font-weight: 400;
    margin: 0 0 var(--spacing-xl) 0;
    text-align: center;
    opacity: 0.8;
}

p {
    margin: 0 0 var(--spacing-md) 0;
    line-height: 1.6;
}

/* Form elements */
.field {
    margin-bottom: var(--spacing-lg);
}

.label {
    color: var(--accent-primary);
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    display: block;
}

input, textarea, select {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: all 0.2s ease;
    width: 100%;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(126, 207, 255, 0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.control {
    position: relative;
}

/* Buttons */
.button, .custom-button {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    box-shadow: 0 2px 8px var(--shadow-light);
}

.button:hover, .custom-button:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(126, 207, 255, 0.3);
}

.button.is-primary {
    background: var(--accent-purple);
    color: white;
}

.button.is-primary:hover {
    background: var(--accent-purple-hover);
}

.button.is-danger {
    background: var(--error);
    color: white;
}

.button.is-danger:hover {
    background: #d32f2f;
    box-shadow: 0 4px 12px rgba(239, 83, 80, 0.3);
}

.button.is-success {
    background: var(--success);
    color: white;
}

.button.is-success:hover {
    background: #4caf50;
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Links */
a, .has-text-link {
    color: var(--accent-primary) !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover, .has-text-link:hover {
    color: var(--accent-secondary) !important;
    text-decoration: underline;
}

/* Tables */
.table {
    background: var(--bg-secondary) !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow);
}

.table th, .table td {
    border-color: var(--bg-tertiary) !important;
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    padding: 1rem !important;
}

.table th {
    background: var(--bg-accent) !important;
    color: var(--accent-primary) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.table tr:hover td {
    background: var(--bg-tertiary) !important;
}

/* Legend color blocks */
.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
    margin-right: 8px;
    display: inline-block;
}

/* Info/alert/notification boxes */
.alert-info, .notification, .notification.is-info, .notification.is-warning {
    background: #23283a !important;
    color: #7ecfff !important;
    border: none !important;
}

/* Additional table styling fixes */
.table.is-dark {
    background: #23283a !important;
    color: #e0e6ef !important;
}
.table.is-dark th {
    background: #23283a !important;
    color: #7ecfff !important;
}
.table.is-dark td {
    background: #23283a !important;
    color: #e0e6ef !important;
}

/* Button group styling */
.buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Form field styling */
.field {
    margin-bottom: 1rem;
}
.field .label {
    color: #7ecfff !important;
    margin-bottom: 0.5rem !important;
}
.control {
    position: relative;
}

/* Schedule and notes */
.tz-label {
    color: #7ecfff;
}
.schedule-range {
    background: #23283a;
    color: #e0e6ef;
    border-radius: 6px;
    padding: 2px 7px;
    font-size: 0.98em;
    font-family: inherit;
}

.schedule-body {
    background: #23283a;
}
.note-card {
    background-color: #2c3244;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
}

.table {
    background-color: #2c2c2c
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        margin-top: 80px;
        padding: var(--spacing-lg);
        width: 98%;
    }
    
    h1, .title.is-1 { font-size: 2rem; }
    h2, .title.is-2 { font-size: 1.75rem; }
    h3, .title.is-3 { font-size: 1.5rem; }
    
    .button, .custom-button {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        margin-top: 70px;
        padding: var(--spacing-md);
        width: 100%;
        border-radius: var(--radius-md);
    }
    
    h1, .title.is-1 { font-size: 1.75rem; }
    h2, .title.is-2 { font-size: 1.5rem; }
}

/* Dashboard headings */

h1 {
    padding: 18px 15px 18px 15px;
}

h2 {
    margin: 0;
    padding: 18px 10px 0 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #7ecfff;
    text-align: center;
    flex: 0 0 auto;
}

/* Log area */
#log {
    background: #181c24;
    border-top: 1px solid #2c3244;
    flex: 1 1 auto;
    padding: 18px 16px;
    overflow-y: auto;
    font-size: 17px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Log lines and user/channel styling */
.log-line {
    margin-bottom: 2px;
    display: flex;
    align-items: flex-start;
}
.timestamp {
    color: #888;
    min-width: 130px;
    flex-shrink: 0;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 2px 4px;
}
.timestamp:hover {
    background: #2c3244;
    color: #7ecfff;
    transform: scale(1.02);
}
.timestamp.clicked {
    background: #7ecfff;
    color: #181c24;
    animation: clickPulse 0.3s ease;
}



@keyframes clickPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.channel {
    font-weight: bold;
    margin: 0 10px 0 10px;
    width: 150px;
    flex-shrink: 0;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user {
    font-weight: bold;
    margin-right: 10px;
    width: 110px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: top;
    position: relative;
}
.user.owner {
    color: #4caf50 !important;
    font-weight: 700;
    background: rgba(76, 175, 80, 0.08);
}
.user.owner::before {
    content: "👑 ";
}
.user.miabot_developer {
    color: #b85c5c !important;
    font-weight: 600;
    background: rgba(184, 92, 92, 0.08);
}
.user.miabot_developer::before {
    content: "🦊 ";
}
.user.admin {
    color: #ff6b6b !important;
    font-weight: 700;
    background: rgba(255, 107, 107, 0.07);
}
.user.admin::before {
    content: "★ ";
}
.user.moderator {
    color: #b39ddb !important;
    font-weight: 700;
    background: rgba(179, 157, 219, 0.08);
}
.user.moderator::before {
    content: "🛡️ ";
}
.user.community_guide {
    color: #f44336;
    font-weight: 600;
}
.user.community_support {
    color: #2196f3;
    font-weight: 600;
}
.user.bot {
    color: #607d8b;
    font-style: italic;
    font-weight: 600;
}
.user.current-user {
    background: linear-gradient(90deg, rgba(142,207,255,0.13), rgba(142,207,255,0.07));
    border: 1px solid rgba(142,207,255,0.18);
    border-radius: 4px;
    padding: 2px 4px;
}
.user.current-user::after {
    content: " ✨";
}

/* Animations */
@keyframes selfGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(126, 207, 255, 0.3); }
    50% { box-shadow: 0 0 15px rgba(126, 207, 255, 0.6); }
}
@keyframes sparkleUser {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}
@keyframes sparkle {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-5deg) scale(1.1); }
    75% { transform: rotate(5deg) scale(1.1); }
}
@keyframes ownerSparkle {
    0%, 100% { transform: rotate(0deg) scale(1); opacity: 1; }
    25% { transform: rotate(-10deg) scale(1.2); opacity: 0.8; }
    50% { transform: rotate(0deg) scale(1.3); opacity: 1; }
    75% { transform: rotate(10deg) scale(1.2); opacity: 0.8; }
}

/* Message and embed styling */
.message {
    background: #181c24 !important;
    color: #f0f2f5 !important;
    border-radius: 4px !important;
    font-size: inherit !important;
    box-shadow: none !important;
}
.embed {
    background: #23283a;
    border-left: 4px solid #7ecfff;
    margin: 6px 0 6px 0;
    padding: 6px 12px;
    font-size: 15px;
    color: #e0e6ef;
}
.embed a {
    color: #7ecfff;
    word-break: break-all;
}
.log-line.new {
    animation: fadeIn 0.7s;
}
@keyframes fadeIn {
    from { background: #2c3244; }
    to { background: transparent; }
}

/* Toast notification for timestamp clicks */
.toast, .notification.is-info, .notification.is-warning {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #7ecfff;
    color: #181c24;
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: bold;
    z-index: 10000;
    animation: toastSlide 0.3s ease;
}
@keyframes toastSlide {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    h2 {
        font-size: 18px;
        padding: 10px 0 6px 0;
    }
    #log {
        font-size: 14px;
        padding: 10px 4px;
    }
    .log-line {
        flex-direction: column;
        align-items: flex-start;
        font-size: 14px;
    }
    .timestamp,
    .channel,
    .user {
        width: auto;
        min-width: 0;
        max-width: 100%;
        margin-right: 4px;
    }
    .user {
        margin-right: 4px;
    }
    .channel {
        margin: 0 4px 0 0;
    }
}

.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.application-table {
    min-width: 900px;
}