/* ΘΕΣΙΣ - Main Stylesheet */
:root {
    --primary-color: #1a237e;
    --secondary-color: #283593;
    --accent-color: #3949ab;
    --success-color: #2e7d32;
    --danger-color: #c62828;
    --warning-color: #f57f17;
    --light-bg: #f5f5f5;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: #333;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.container-narrow {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.header-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

.header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Navigation */
.nav {
    background: white;
    padding: 10px 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.nav a, .nav button {
    padding: 8px 16px;
    text-decoration: none;
    color: var(--primary-color);
    border-radius: var(--border-radius);
    transition: all 0.3s;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.95rem;
}

.nav a:hover, .nav button:hover {
    background: var(--primary-color);
    color: white;
}

.nav a.active {
    background: var(--primary-color);
    color: white;
}

.nav .logout-btn {
    background: var(--danger-color);
    color: white;
}

.nav .logout-btn:hover {
    background: #b71c1c;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 25px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-bg);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
}

.form-group label .required {
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-control.error {
    border-color: var(--danger-color);
}

.form-control.success {
    border-color: var(--success-color);
}

/* Select */
select.form-control {
    cursor: pointer;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-item label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
}

/* Photo Upload */
.photo-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.photo-preview {
    width: 150px;
    height: 180px;
    border: 2px dashed #ddd;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fafafa;
}

.photo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.photo-preview .placeholder {
    color: #999;
    text-align: center;
    padding: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
}

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

.btn-success:hover {
    background: #1b5e20;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #b71c1c;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #e65100;
}

.btn-secondary {
    background: #757575;
    color: white;
}

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

/* Button group */
.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

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

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

.table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.table tr:hover {
    background: #f9f9f9;
}

.table .actions {
    display: flex;
    gap: 5px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.alert-success {
    background: #e8f5e9;
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: #ffebee;
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #1976d2;
}

/* Validation messages */
.validation-message {
    font-size: 0.85rem;
    margin-top: 5px;
}

.validation-message.error {
    color: var(--danger-color);
}

.validation-message.success {
    color: var(--success-color);
}

/* Legal text */
.legal-text {
    background: #f9f9f9;
    padding: 15px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 15px;
    border: 1px solid #ddd;
}

.legal-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.legal-checkbox input {
    margin-top: 3px;
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
}

.login-title {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-subtitle {
    color: #666;
    margin-bottom: 30px;
}

.login-divider {
    margin: 30px 0;
    border: none;
    border-top: 1px solid #ddd;
}

.scanner-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: var(--light-bg);
    border-radius: var(--border-radius);
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s;
}

.scanner-link:hover {
    background: var(--primary-color);
    color: white;
}

.scanner-link svg {
    width: 24px;
    height: 24px;
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 25px;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: #666;
    font-size: 0.95rem;
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: var(--border-radius);
}

.filters label {
    font-weight: 600;
}

.filters select,
.filters input {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
}

/* Scanner Page */
.scanner-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
}

.scanner-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scanner-header h1 {
    font-size: 1.2rem;
}

.scanner-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.scanner-video-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: #000;
}

#scanner-video {
    width: 100%;
    display: block;
}

.scanner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 3px solid white;
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.scanner-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
}

.scanner-result.valid {
    background: var(--success-color);
    color: white;
}

.scanner-result.invalid {
    background: var(--danger-color);
    color: white;
}

.scanner-result.expired {
    background: var(--warning-color);
    color: white;
}

.scanner-result .member-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.scanner-result .member-group {
    font-size: 1.1rem;
    opacity: 0.9;
}

.scanner-result .status-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* Play selection */
.play-input {
    margin: 20px auto;
    max-width: 500px;
}

.play-input input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    text-align: center;
}

/* Sync status */
.sync-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--border-radius);
    color: white;
    font-size: 0.85rem;
}

.sync-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.sync-indicator.online {
    background: var(--success-color);
}

.sync-indicator.offline {
    background: var(--danger-color);
}

/* Scans log */
.scans-log {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(255,255,255,0.1);
    border-radius: var(--border-radius);
    padding: 15px;
}

.scan-entry {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    color: white;
}

.scan-entry:last-child {
    border-bottom: none;
}

/* Membership Card */
.membership-card {
    width: 7cm;
    height: 15cm;
    background: white;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px auto;
    border: 2px solid var(--primary-color);
}

.membership-card .card-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
}

.membership-card .card-org-name {
    font-size: 0.7rem;
    color: #666;
    text-align: center;
    margin-bottom: 15px;
}

.membership-card .card-photo {
    width: 100px;
    height: 120px;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 15px;
}

.membership-card .card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.membership-card .card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 5px;
}

.membership-card .card-group {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    margin-bottom: 15px;
}

.membership-card .card-qr {
    width: 100px;
    height: 100px;
    margin-bottom: 10px;
}

.membership-card .card-qr img {
    width: 100%;
    height: 100%;
}

.membership-card .card-expiry {
    font-size: 0.75rem;
    color: var(--danger-color);
    text-align: center;
}

.membership-card .card-expiry-label {
    font-size: 0.65rem;
    color: #999;
}

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

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--success-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .nav {
        padding: 10px;
    }
    
    .nav a, .nav button {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .checkbox-group {
        flex-direction: column;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* Print styles for membership card */
@media print {
    body * {
        visibility: hidden;
    }
    
    .membership-card,
    .membership-card * {
        visibility: visible;
    }
    
    .membership-card {
        position: absolute;
        left: 0;
        top: 0;
        box-shadow: none;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.p-0 { padding: 0; }
.p-1 { padding: 10px; }
.p-2 { padding: 20px; }

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }

.hidden {
    display: none !important;
}

/* Subscription Status Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 12px;
    white-space: nowrap;
}

.badge-success {
    background: #4caf50;
    color: white;
}

.badge-danger {
    background: #f44336;
    color: white;
}

.badge-warning {
    background: #ff9800;
    color: white;
}

.badge-secondary {
    background: #9e9e9e;
    color: white;
}
