/* ძირითადი სტილები */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4CAF50;
    --primary-dark: #45a049;
    --secondary-color: #2196F3;
    --secondary-dark: #1976D2;
    --accent-color: #FF6B35;
    --accent-dark: #F7931E;
    --background-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-dark: #333;
    --text-light: #666;
    --border-color: #ddd;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --shadow-light: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 10px 30px rgba(0, 0, 0, 0.2);
    --shadow-heavy: 0 15px 40px rgba(0, 0, 0, 0.3);
    --border-radius: 15px;
    --border-radius-small: 8px;
    --transition-standard: all 0.3s ease;
}

body {
    font-family: 'BPG Nino Mtavruli', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background-gradient);
    min-height: 100vh;
    line-height: 1.6;
    color: var(--text-dark);
}

/* კონტეინერი */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ჰედერი */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.logo {
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 32px;
    font-weight: bold;
    box-shadow: var(--shadow-light);
    transition: var(--transition-standard);
}

.logo:hover {
    transform: scale(1.05) rotate(5deg);
}

h1 {
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.2rem;
    margin-bottom: 0;
}

/* ნავიგაცია */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.nav-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: var(--transition-standard);
    box-shadow: var(--shadow-light);
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.nav-btn:hover::before {
    left: 100%;
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

.nav-btn.admin {
    background: linear-gradient(45deg, var(--accent-color), var(--accent-dark));
}

.nav-btn:active {
    transform: translateY(-1px);
    transition: transform 0.1s;
}

/* შინაარსის სექციები */
.content-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 40px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-medium);
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-dark);
    font-size: 2.5rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* შეტყობინებები */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius-small);
    margin-bottom: 20px;
    display: none;
    animation: slideDown 0.3s ease-out;
    position: relative;
    border-left: 4px solid;
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border-color: var(--success-color);
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border-color: var(--error-color);
}

.alert.warning {
    background: #fff3cd;
    color: #856404;
    border-color: var(--warning-color);
}

.alert.info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: var(--info-color);
}

/* სტატისტიკა */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: var(--transition-standard);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transition: var(--transition-standard);
    transform: scale(0);
}

.stat-card:hover::before {
    transform: scale(1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* სერვისები */
.info-section {
    margin-top: 40px;
}

.info-section h3 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-dark);
    font-size: 2rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.service-item {
    background: var(--white);
    padding: 30px 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: var(--transition-standard);
    border: 2px solid transparent;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.service-item h4 {
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.service-item p {
    color: var(--text-light);
    line-height: 1.5;
}

/* ფორმები */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.form-group small {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 5px;
    display: block;
}

input, select, textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-small);
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition-standard);
    background: var(--white);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    transform: translateY(-2px);
}

input:invalid {
    border-color: var(--error-color);
}

input:valid {
    border-color: var(--success-color);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ღილაკები */
.submit-btn, .control-btn, .save-btn, .generate-btn, .search-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border: none;
    padding: 15px 30px;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    font-family: inherit;
    transition: var(--transition-standard);
    box-shadow: var(--shadow-light);
    position: relative;
    overflow: hidden;
}

.submit-btn {
    width: 100%;
    padding: 20px;
    font-size: 18px;
    margin-top: 20px;
}

.control-btn.secondary {
    background: linear-gradient(45deg, var(--text-light), #555);
}

.control-btn.refresh {
    background: linear-gradient(45deg, var(--info-color), #138496);
}

.submit-btn:hover, .control-btn:hover, .save-btn:hover, .generate-btn:hover, .search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.submit-btn:active, .control-btn:active, .save-btn:active, .generate-btn:active, .search-btn:active {
    transform: translateY(0);
}

/* რიგის ეკრანი */
.queue-display {
    background: linear-gradient(45deg, var(--secondary-color), var(--secondary-dark));
    color: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 30px;
    box-shadow: var(--shadow-medium);
}

.current-number {
    margin-bottom: 30px;
}

.queue-label {
    font-size: 1.5rem;
    opacity: 0.9;
    display: block;
    margin-bottom: 10px;
}

.queue-number {
    font-size: 5rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.next-queue {
    font-size: 1.8rem;
    font-weight: bold;
    opacity: 0.8;
}

.queue-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* პაციენტების სია */
.patient-list {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.list-header {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 20px;
    font-size: 1.3rem;
    font-weight: bold;
}

.patient-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-standard);
}

.patient-item:last-child {
    border-bottom: none;
}

.patient-item:hover {
    background: var(--light-gray);
    transform: translateX(5px);
}

.patient-info {
    flex: 1;
}

.patient-name {
    font-weight: bold;
    color: var(--text-dark);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.patient-details {
    color: var(--text-light);
    font-size: 0.9rem;
}

.status-badge {
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-waiting {
    background: #fff3cd;
    color: #856404;
}

.status-processing {
    background: #d1ecf1;
    color: #0c5460;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

/* ადმინისტრირება */
.admin-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 30px;
    background: var(--light-gray);
    border-radius: var(--border-radius-small);
    padding: 5px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: var(--text-light);
    border-radius: var(--border-radius-small);
    transition: var(--transition-standard);
}

.tab-btn.active {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-light);
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.search-section {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.search-section input {
    flex: 1;
}

/* ცხრილები */
.patients-table {
    overflow-x: auto;
    border-radius: var(--border-radius-small);
    box-shadow: var(--shadow-light);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

table th {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 15px;
    text-align: left;
    font-weight: bold;
}

table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

table tr:hover {
    background: var(--light-gray);
}

/* რეპორტები */
.report-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.report-filters input {
    max-width: 200px;
}

.report-content {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius-small);
    box-shadow: var(--shadow-light);
    min-height: 300px;
}

/* პარამეტრები */
.settings-section {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius-small);
    box-shadow: var(--shadow-light);
}

.settings-section h3 {
    margin-bottom: 25px;
    color: var(--text-dark);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

/* რესპონსიული დიზაინი */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 20px;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .logo {
        width: 80px;
        height: 80px;
        font-size: 24px;
    }
    
    .main-nav {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .queue-number {
        font-size: 3.5rem;
    }
    
    .queue-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .patient-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .search-section {
        flex-direction: column;
    }
    
    .report-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .report-filters input {
        max-width: none;
    }
    
    table {
        font-size: 14px;
    }
    
    table th, table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .content-section {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .queue-number {
        font-size: 2.5rem;
    }
    
    input, select, textarea {
        font-size: 16px; /* iOS-ისთვის zoom-ის თავიდან ასაცილებლად */
    }
}

/* დამატებითი ანიმაციები */
@keyframes slideInFromLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInFromRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.bounce {
    animation: bounce 1s;
}

/* მუქი თემის მხარდაჭერა */
@media (prefers-color-scheme: dark) {
    :root {
        --background-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        --text-dark: #ecf0f1;
        --text-light: #bdc3c7;
        --border-color: #34495e;
        --white: #2c3e50;
        --light-gray: #34495e;
    }
}

/* პრინტის სტილები */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .main-nav, .queue-controls, .admin-tabs {
        display: none;
    }
    
    .content-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}