/* Base styles - Theme-agnostic layout and mobile responsiveness */

/* Base Layout */
body {
    margin: 0;
    padding: 20px;
    font-family: Arial, sans-serif;
}

/* Information Notes */
.note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
    color: #856404;
    font-size: 14px;
}

.note strong {
    color: #5a4a06;
}

.note small {
    color: #6c5e0c;
    font-style: italic;
}

.beos-container {
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
}

.beos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.beos-tabs {
    display: flex;
}

.tab-btn {
    cursor: pointer;
    position: relative;
    padding: 10px 20px;
    border: none;
    background: transparent;
}

.tab-content {
    padding: 20px;
}

.beos-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    text-align: center;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.toolbar {
    margin-bottom: 12px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    gap: 8px;
}

.activity-list {
    /* Base layout */
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 12px;
}

.activity-time {
    color: #666;
    font-size: 11px;
}

.activity-desc {
    flex: 1;
    margin-left: 10px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal:not(.hidden) {
    display: flex;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    min-width: 300px;
    max-width: 500px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 15px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.tab-pane {
    display: none;
}

.tab-pane:not(.hidden) {
    display: block;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.setting-group {
    margin-bottom: 15px;
}

.setting-group label {
    display: block;
    margin-bottom: 5px;
}

.setting-group input,
.setting-group select,
.setting-group textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.template-section {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Profile Section Styles */
.profile-info {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.api-key-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.api-key-display {
    font-family: monospace;
    background: #f0f0f0;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    word-break: break-all;
    flex: 1;
    min-width: 200px;
}

.api-key-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.password-change-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    max-width: 400px;
}

/* Screen management */
.screen {
    display: none;
}

#modeSelector {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

#loginScreen {
    display: none;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

#registerScreen {
    display: none;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-window {
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    min-width: 300px;
}

.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.mode-buttons button {
    padding: 12px 20px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

.mode-buttons button:hover {
    background: #f0f0f0;
}

/* Basic button styles */
button {
    padding: 8px 16px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

button:hover {
    background: #f0f0f0;
}

button.secondary {
    background: #f8f8f8;
}

button.danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Error and success messages */
.error {
    color: #dc3545;
    margin-top: 10px;
}

.success {
    color: #28a745;
    margin-top: 10px;
}

/* Table styles */
.table-container {
    overflow-x: auto;
}

.beos-table th,
.beos-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.beos-table th {
    background: #f8f9fa;
    font-weight: bold;
}

/* Status badges */
.status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-new {
    background: #e3f2fd;
    color: #1976d2;
}

.status-issued {
    background: #fff3e0;
    color: #f57c00;
}

.status-used {
    background: #e8f5e8;
    color: #388e3c;
}

/* Utilities */
.hidden {
    display: none !important;
}

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

@media screen and (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 14px;
    }
    
    .beos-container {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }
    
    /* Header adjustments */
    .beos-header {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .beos-header h1 {
        font-size: 16px;
        margin: 0;
    }
    
    .logout-btn {
        align-self: center;
        padding: 8px 16px;
        font-size: 12px;
    }
    
    /* Tabs mobile layout */
    .beos-tabs {
        flex-wrap: wrap;
        border-bottom: 1px solid #ccc;
        padding: 0;
        background: #f8f9fa;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 0;
        padding: 12px 8px;
        font-size: 12px;
        text-align: center;
        border: none;
        background: transparent;
    }
    
    /* Tables responsive */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .beos-table {
        min-width: 600px;
        font-size: 12px;
    }
    
    .beos-table th,
    .beos-table td {
        padding: 6px 8px;
        white-space: nowrap;
    }
    
    /* Stats grid mobile */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .stat-card {
        padding: 10px;
        font-size: 12px;
    }
    
    /* Modal adjustments */
    .modal-content {
        margin: 10px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }
    
    /* Login window mobile */
    .login-window {
        margin: 10px;
        min-width: auto;
        width: calc(100vw - 20px);
        max-width: 400px;
    }
    
    /* Form elements */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Buttons touch-friendly */
    button,
    .tab-btn {
        min-height: 44px;
        font-size: 14px;
    }
    
    .mode-buttons button {
        padding: 15px 20px;
    }
    
    /* Settings mobile */
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-actions {
        flex-direction: column;
    }
    
    .toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .toolbar button {
        flex: 1;
        min-width: 0;
        font-size: 12px;
        padding: 10px 8px;
    }
    
    /* Activity list mobile */
    .activity-list {
        font-size: 12px;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 4px;
    }
}

@media screen and (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .beos-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: 1px solid #ddd;
    }
    
    .toolbar {
        flex-direction: column;
    }
}