/* Kinderon Web Portal - Shared Styles */

:root {
    --primary: #2196F3;
    --primary-dark: #1976D2;
    --secondary: #4CAF50;
    --danger: #f44336;
    --warning: #FF9800;
    --success: #4CAF50;
    --bg-light: #f7f9fc;
    --card-bg: #ffffff;
    --border: #e0e0e0;
    --text: #333;
    --text-light: #666;
    --shadow: rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-light);
    color: var(--text);
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background: var(--card-bg);
    box-shadow: 0 2px 8px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-top {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-menu {
    display: flex;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    background: linear-gradient(to bottom, #fafafa, #f0f0f0);
    border-bottom: 2px solid var(--primary);
}

.navbar-menu li {
    flex: 0 0 auto;
}

.navbar-menu a {
    color: var(--text);
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    display: block;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    font-size: 0.95rem;
}

.navbar-menu a:hover {
    background: rgba(33, 150, 243, 0.1);
    border-bottom-color: var(--primary);
}

.navbar-menu a.active {
    background: var(--primary);
    color: white;
    border-bottom-color: var(--primary-dark);
}

/* Responsive navbar */
@media (max-width: 1200px) {
    .navbar-menu {
        font-size: 0.9rem;
    }
    .navbar-menu a {
        padding: 0.65rem 1rem;
    }
}

@media (max-width: 900px) {
    .navbar-menu {
        justify-content: flex-start;
    }
    .navbar-menu a {
        padding: 0.6rem 0.85rem;
        font-size: 0.85rem;
    }
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.card-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    color: var(--text);
}

/* Stats */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-card.success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.stat-card.danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-light);
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    color: var(--text);
}

tr:hover {
    background: var(--bg-light);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

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

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

.btn-success:hover {
    background: #45a049;
}

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

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

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-warning {
    background: #fff3e0;
    color: #e65100;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

.badge-primary {
    background: #e3f2fd;
    color: #1565c0;
}

/* Progress Bar */
.progress {
    height: 20px;
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    transition: width 0.3s;
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-lg {
    width: 80px;
    height: 80px;
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary);
    font-size: 2rem;
}

.login-header p {
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4CAF50;
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

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

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

/* Loading Spinner */
.spinner {
    border: 3px solid var(--bg-light);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Help Tooltips */
.help-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    margin-left: 0.5rem;
    position: relative;
}

.help-icon:hover {
    background: var(--primary-dark);
}

.help-icon .tooltip {
    visibility: hidden;
    width: 280px;
    background: #333;
    color: white;
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -140px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 13px;
    line-height: 1.4;
    font-weight: normal;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.help-icon .tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.help-icon:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.help-section {
    background: #e3f2fd;
    border-left: 4px solid var(--primary);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.help-section h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.help-section ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .navbar-menu {
        flex-direction: column;
        width: 100%;
        text-align: center;
    }
    
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .help-icon .tooltip {
        width: 220px;
        margin-left: -110px;
        font-size: 12px;
    }
}
