/* ========================================
   Karate Database - Professional Design
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    background: #1a1a1a;
    color: #d0d0d0;
    line-height: 1.6;
}

#mainContent {
    transition: margin-left 0.3s ease;
}

#mobileTopBar {
    display: none;
}

/* ========================================
   Login Page
   ======================================== */

.login-body {
    background: #1a1a1a;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: #252525;
    padding: 40px;
    border-radius: 4px;
    border: 1px solid #333333;
    width: 90%;
    max-width: 380px;
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-placeholder {
    width: 60px;
    height: 60px;
    background: #dc3545;
    border-radius: 4px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    font-weight: 600;
}

.logo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.login-container h1 {
    color: #ffffff;
    font-size: 24px;
    margin-bottom: 6px;
    text-align: center;
    font-weight: 600;
}

.subtitle {
    color: #999999;
    font-size: 13px;
    margin-bottom: 25px;
    text-align: center;
}

label {
    display: block;
    margin-bottom: 6px;
    color: #a0a0a0;
    font-weight: 500;
    font-size: 12px;
}

input {
    width: 100%;
    padding: 10px;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    font-size: 14px;
    background: #2a2a2a;
    color: #d0d0d0;
    font-family: inherit;
}

input:focus {
    outline: none;
    border-color: #dc3545;
    background: #303030;
}

input::placeholder {
    color: #666666;
}

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

.error {
    background: #3c2a2a;
    color: #ff6b6b;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
    border: 1px solid #552222;
}

.btn-login {
    width: 100%;
    padding: 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}

.btn-login:hover {
    background: #c82333;
}

/* ========================================
   Container & Layout
   ======================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px;
}

.card {
    background: #252525;
    border-radius: 4px;
    padding: 25px;
    border: 1px solid #333333;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 24px;
    color: #ffffff;
    margin: 0;
    font-weight: 600;
}

.subtitle-text {
    color: #888888;
    margin-bottom: 16px;
    font-size: 13px;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    padding: 9px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #dc3545;
    color: white;
}

.btn-primary:hover {
    background: #c82333;
}

.btn-secondary {
    background: #3a3a3a;
    color: #d0d0d0;
    border: 1px solid #444444;
}

.btn-secondary:hover {
    background: #444444;
}

.btn-danger {
    background: #3c2a2a;
    color: #ff6b6b;
    border: 1px solid #552222;
}

.btn-danger:hover {
    background: #dc3545;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ========================================
   Forms
   ======================================== */

select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    font-size: 14px;
    background: #2a2a2a;
    color: #d0d0d0;
    font-family: inherit;
}

select:focus, textarea:focus {
    outline: none;
    border-color: #dc3545;
    background: #303030;
}

select option {
    background: #1a1a1a;
    color: #d0d0d0;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-group, .radio-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.checkbox-group input, .radio-group input {
    width: auto;
    cursor: pointer;
    accent-color: #dc3545;
}

.checkbox-group label, .radio-group label {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
    font-size: 13px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid-full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #333333;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.inline-form-input {
    flex: 1;
    margin: 0;
}

/* ========================================
   Tables
   ======================================== */

.table-wrapper {
    overflow-x: auto;
    border-radius: 4px;
    border: 1px solid #333333;
    margin-top: 12px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #2a2a2a;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #dc3545;
    border-bottom: 1px solid #333333;
    font-size: 12px;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid #333333;
    font-size: 13px;
    color: #d0d0d0;
}

.table tbody tr:hover {
    background: #2a2a2a;
}

/* ========================================
   Stats & Cards
   ======================================== */

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

.stat-card {
    background: linear-gradient(135deg, #dc3545 0%, #bb2d3b 100%);
    color: white;
    padding: 24px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #c82333;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.15);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
}

.stat-value {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.95;
}

/* ========================================
   Member Detail
   ======================================== */

.member-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-section {
    background: #2a2a2a;
    padding: 16px;
    border-radius: 4px;
    border: 1px solid #333333;
}

.section-heading {
    margin-bottom: 12px;
    color: #dc3545;
    font-size: 14px;
    font-weight: 600;
}

.detail-row {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333333;
}

.detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-label {
    font-weight: 600;
    color: #888888;
    font-size: 11px;
    margin-bottom: 3px;
}

.detail-value {
    color: #d0d0d0;
    font-size: 13px;
    word-break: break-word;
}

/* ========================================
   Location Cards
   ======================================== */

.location-card {
    border: 1px solid #333333;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
    background: #2a2a2a;
}

.location-card:hover {
    border-color: #444444;
}

.location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.location-name {
    color: #dc3545;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.location-info {
    color: #888888;
    font-size: 13px;
}

.stats-box {
    background: #1a1a1a;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 16px;
    border: 1px solid #333333;
}

.stats-title {
    margin-bottom: 8px;
    color: #d0d0d0;
    font-size: 12px;
    font-weight: 600;
}

.stats-inline {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stats-label {
    color: #888888;
    font-weight: 500;
    font-size: 12px;
}

.stats-present {
    color: #4ade80;
    font-weight: 600;
    margin-left: 6px;
}

.stats-absent {
    color: #ff6b6b;
    font-weight: 600;
    margin-left: 6px;
}

/* ========================================
   Attendance
   ======================================== */

.attendance-heading {
    margin-bottom: 12px;
    color: #d0d0d0;
    font-size: 13px;
    font-weight: 600;
}

.attendance-grid {
    display: grid;
    gap: 6px;
}

.attendance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #2a2a2a;
    border-radius: 4px;
    border: 1px solid #333333;
}

.attendance-item:hover {
    background: #303030;
}

.attendance-name {
    color: #d0d0d0;
    font-weight: 500;
    font-size: 13px;
}

.attendance-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.radio-label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: normal;
    color: #d0d0d0;
    font-size: 12px;
}

.radio-label input {
    width: auto;
    cursor: pointer;
    accent-color: #dc3545;
}

.radio-label:hover {
    color: #dc3545;
}

/* ========================================
   Messages & Alerts
   ======================================== */

.success-message {
    background: #2a3c2a;
    color: #4ade80;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 16px;
    border: 1px solid #3c5c3c;
    font-weight: 500;
    font-size: 13px;
}

.error-message {
    background: #3c2a2a;
    color: #ff6b6b;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 16px;
    border: 1px solid #5c3c3c;
    font-weight: 500;
    font-size: 13px;
}

.empty-state {
    text-align: center;
    color: #888888;
    padding: 30px 20px;
    font-size: 13px;
}

/* ========================================
   Search Bar
   ======================================== */

.search-bar {
    position: relative;
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    font-size: 13px;
    background: #2a2a2a;
    color: #d0d0d0;
}

.search-input:focus {
    border-color: #dc3545;
    background: #303030;
    outline: none;
}

.search-input::placeholder {
    color: #666666;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    #sidebar {
        width: 240px !important;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.5);
    }
    
    #mainContent {
        margin-left: 0 !important;
        margin-top: 56px !important;
    }
    
    .form-grid, .member-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 16px;
        border-radius: 4px;
    }
    
    .card-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .card-header .btn {
        width: 100%;
        text-align: center;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .inline-form .btn {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .location-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .location-header .btn {
        width: 100%;
    }
    
    .card-title {
        font-size: 20px;
    }
    
    .stats-inline {
        flex-direction: column;
        gap: 10px;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th, .table td {
        padding: 10px 8px;
    }
    
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 800px;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 16px auto;
        padding: 0 12px;
    }
    
    .card {
        padding: 14px;
        margin-bottom: 12px;
    }
    
    .card-title {
        font-size: 18px;
    }
    
    .login-container {
        padding: 25px;
        max-width: 95%;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 18px;
    }
    
    .stat-value {
        font-size: 32px;
    }
    
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 800px;
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444444;
}

/* ========================================
   Dashboard Specific Styles
   ======================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.stat-link {
    display: inline-block;
    margin-top: 8px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.stat-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.birthday-section {
    margin-top: 30px;
    padding: 20px;
    background: #2a2a2a;
    border-radius: 6px;
    border: 1px solid #333333;
}

.birthday-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.birthday-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #1a1a1a;
    border-radius: 4px;
    border-left: 3px solid #dc3545;
}

.birthday-age {
    color: #888888;
    font-size: 13px;
}

.quick-actions {
    margin-top: 30px;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 15px;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
    background: #2a2a2a;
    border: 1px solid #333333;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.action-button:hover {
    background: #303030;
    border-color: #dc3545;
    transform: translateY(-2px);
}

.action-icon {
    font-size: 32px;
    min-width: 40px;
    text-align: center;
}

.action-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 3px;
}

.action-desc {
    color: #888888;
    font-size: 12px;
}

.subtitle-text {
    color: #888888;
    font-size: 14px;
    margin-top: 5px;
}

    }
    
    .card {
        border: 1px solid #333;
        margin-bottom: 15px;
    }
}
