/*
 * MODERN DESIGN STYLESHEET - Версия 11.0
 * Beautiful, modern design with glassmorphism and smooth animations
 * Обновлено: Принудительное обновление кэша
 * Изменения: Новый дизайн, расположение точек в 2 колонки
 */

/* --- Base & Body --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --danger-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    --shadow-light: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    --shadow-heavy: 0 20px 60px 0 rgba(0, 0, 0, 0.3);
    --border-radius: 20px;
    --border-radius-small: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--primary-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    padding: 20px;
    min-height: 100vh;
    text-align: center;
    position: relative;
    overflow-x: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    animation: backgroundShift 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes backgroundShift {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-20px) translateY(-10px); }
    50% { transform: translateX(20px) translateY(10px); }
    75% { transform: translateX(-10px) translateY(20px); }
}

/* --- Screen Management --- */
.screen {
    display: none;
    animation: fadeInUp 0.6s ease-out;
}

.screen.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Preloader --- */
#preloader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    z-index: 100;
    transition: var(--transition);
}

#preloader.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

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

/* --- Glassmorphism Card Style --- */
.welcome-container, .main-container > div, .login-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    padding: 40px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.welcome-container::before, .main-container > div::before, .login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.welcome-container:hover, .main-container > div:hover, .login-container:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

/* --- General Containers --- */
.welcome-container, .main-container, .login-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 500px;
    margin: 0 auto;
}

/* --- Typography --- */
h1 { 
    font-size: 32px; 
    font-weight: 700; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 { 
    font-size: 24px; 
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.welcome-header p, .login-container p { 
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1.6;
}

/* --- Main Screen --- */
.main-header {
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: var(--border-radius-small);
    border: 1px solid var(--glass-border);
    margin-bottom: 20px;
    transition: var(--transition);
}

.main-header:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.user-info { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.user-avatar { 
    width: 50px; 
    height: 50px; 
    border-radius: 50%; 
    border: 3px solid rgba(255,255,255,0.3);
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.user-details { 
    text-align: left; 
}

.user-fullname { 
    font-weight: 600; 
    display: block; 
    font-size: 16px;
    color: var(--text-primary);
}

.user-username { 
    color: var(--text-muted); 
    font-size: 14px; 
}

/* --- Location Selector --- */
.location-selector {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: var(--border-radius);
    padding: 30px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-light);
    margin-bottom: 20px;
    transition: var(--transition);
}

.location-selector:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.location-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.selected-location { 
    margin-top: 20px; 
    font-weight: 600; 
    font-size: 20px; 
    color: var(--text-primary);
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-small);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Timer --- */
.timer-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    padding: 40px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-medium);
    margin-bottom: 20px;
    transition: var(--transition);
}

.timer-container:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.timer-circle {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 30px auto;
    transition: var(--transition);
}

.timer-circle:hover {
    transform: scale(1.02);
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.timer-circle-progress {
    fill: none;
    stroke: url(#timerGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 0.3s ease;
    filter: drop-shadow(0 0 10px rgba(79, 172, 254, 0.5));
}

.timer-time {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 52px;
    font-weight: 700;
    font-family: 'Inter', monospace;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timer-controls {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.timer-info {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 20px;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: var(--border-radius-small);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-card { 
    text-align: center; 
}

.info-label { 
    color: var(--text-muted); 
    font-size: 14px; 
    display: block;
    margin-bottom: 5px;
}

.info-value { 
    font-weight: 600; 
    font-size: 20px;
    color: var(--text-primary);
}

/* SVG Gradient Definition */
.timer-svg defs {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* --- Buttons --- */
.btn {
    padding: 15px 25px;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.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;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover { 
    transform: translateY(-3px); 
    box-shadow: var(--shadow-medium);
}

.btn:active { 
    transform: translateY(-1px); 
}

.btn-primary { 
    background: var(--secondary-gradient);
    color: white;
    box-shadow: var(--shadow-light);
}

.btn-secondary { 
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-success { 
    background: var(--success-gradient);
    color: white;
    box-shadow: var(--shadow-light);
}

.btn-danger { 
    background: var(--danger-gradient);
    color: white;
    box-shadow: var(--shadow-light);
}

.btn-large { 
    padding: 20px 40px; 
    font-size: 24px;
    border-radius: var(--border-radius);
}

.location-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    font-weight: 500;
    transition: var(--transition);
}

.location-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.location-btn.selected {
    background: var(--secondary-gradient);
    box-shadow: 0 0 20px rgba(240, 147, 251, 0.4);
    color: white;
    transform: translateY(-2px);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 16px;
}

input[type="text"] {
    width: 100%;
    padding: 18px 20px;
    border-radius: var(--border-radius-small);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 16px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

input[type="text"]::placeholder { 
    color: var(--text-muted); 
}

input[type="text"]:focus {
    outline: none;
    border-color: rgba(240, 147, 251, 0.5);
    box-shadow: 0 0 0 3px rgba(240, 147, 251, 0.2);
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* --- Login Screen --- */
.login-screen { 
    text-align: center; 
}

/* --- Notice Card --- */
.notice-card {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: var(--border-radius-small);
    padding: 20px;
    margin-top: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* --- Toast Notifications --- */
.toast-container { 
    position: fixed; 
    top: 20px; 
    right: 20px; 
    z-index: 1000;
    max-width: 350px;
}

.toast { 
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px 25px; 
    border-radius: var(--border-radius-small); 
    margin-bottom: 15px; 
    color: var(--text-primary); 
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--glass-border);
    border-left: 4px solid #4facfe;
    animation: slideInRight 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.toast.error { 
    border-left-color: #fa709a; 
}

.toast.success { 
    border-left-color: #4facfe; 
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .welcome-container, .main-container > div, .login-container {
        padding: 25px;
        margin: 10px;
    }
    
    .timer-circle {
        width: 200px;
        height: 200px;
    }
    
    .timer-time {
        font-size: 42px;
    }
    
    .location-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .timer-info {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
    }
    
    .btn-large {
        padding: 15px 30px;
        font-size: 20px;
    }
    
    h1 {
        font-size: 28px;
    }
    
    h2 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .location-buttons {
        grid-template-columns: 1fr;
    }
    
    .timer-circle {
        width: 180px;
        height: 180px;
    }
    
    .timer-time {
        font-size: 36px;
    }
    
    .main-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .user-details {
        text-align: center;
    }
}

/* --- Admin Panel Styles --- */
.admin-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    padding: 30px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-medium);
    margin-bottom: 20px;
    transition: var(--transition);
}

.admin-container:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-small);
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.admin-section {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-small);
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-section h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 20px;
}

.search-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input, .filter-select, .date-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border-radius: var(--border-radius-small);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus, .filter-select:focus, .date-input:focus {
    outline: none;
    border-color: rgba(240, 147, 251, 0.5);
    box-shadow: 0 0 0 3px rgba(240, 147, 251, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.date-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.items-grid {
    display: grid;
    gap: 15px;
}

.user-item, .record-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-small);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-item:hover, .record-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-light);
}

.user-info, .record-info {
    flex: 1;
}

.user-name, .record-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.user-details, .record-details {
    font-size: 14px;
    color: var(--text-muted);
}

.user-stats, .record-stats {
    text-align: right;
}

.user-hours, .record-hours {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.user-location, .record-status {
    font-size: 14px;
    color: var(--text-muted);
}

.record-status.active {
    color: #4facfe;
    font-weight: 500;
}

.record-status.completed {
    color: #28a745;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

.btn-icon {
    font-size: 24px;
    margin-right: 10px;
}

.btn-content {
    text-align: left;
}

.btn-title {
    font-weight: 600;
    font-size: 16px;
}

.btn-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

/* Responsive Admin Panel */
@media (max-width: 768px) {
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .search-input, .filter-select, .date-input {
        min-width: auto;
    }
    
    .date-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .user-item, .record-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .user-stats, .record-stats {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}
