/* Reset in osnovni stil */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

header h1 {
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 700;
}

nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

nav span {
    color: #7f8c8d;
    font-weight: 500;
}

/* Gumbi */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

/* Glavna vsebina */
main {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Sekcije števcev */
.counters-section {
    margin-bottom: 40px;
}

.counters-section:last-child {
    margin-bottom: 0;
}

.counters-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

/* Števci samo za vpogled */
.counters-grid.view-only .counter-card {
    opacity: 0.8;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.counters-grid.view-only .counter-card:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.counter-card.view-only h3 {
    color: #6c757d;
}

.counter-card.view-only .counter-description {
    color: #adb5bd;
}

/* Mreža števcev */
.counters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.counter-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #ecf0f1;
}

.counter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.counter-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.counter-description {
    color: #7f8c8d;
    margin-bottom: 20px;
    font-style: italic;
}

.last-reading {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
}

.last-reading p {
    margin-bottom: 5px;
}

/* Računske razlike */
.reading-difference {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.reading-difference p {
    margin-bottom: 3px;
    font-size: 0.9rem;
}

.reading-difference .positive {
    color: #28a745;
    font-weight: 600;
}

.reading-difference .negative {
    color: #dc3545;
    font-weight: 600;
}

.no-reading {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #ffc107;
    color: #856404;
}

/* Opozorila */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

/* Forme */
.form-large {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Login stran */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

/* Admin sekcije */
.admin-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #ecf0f1;
}

.admin-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.admin-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* Mreža uporabnikov */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

/* Mreža števcev za admin */
.counters-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.counter-admin-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #ecf0f1;
}

.counter-admin-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.counter-stats {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #3498db;
}

.counter-stats p {
    margin-bottom: 8px;
    color: #7f8c8d;
}

.counter-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.user-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #ecf0f1;
}

.user-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.user-card p {
    margin-bottom: 10px;
    color: #7f8c8d;
}

.user-actions {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.assigned-counters {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

.assigned-counters h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1rem;
}

.assigned-counters ul {
    list-style: none;
    padding-left: 0;
}

.assigned-counters li {
    background: #f8f9fa;
    padding: 5px 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    border-left: 3px solid #3498db;
}

/* Checkbox skupine */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 3% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

/* Informacije o števcu */
.counter-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-top: 30px;
    border-left: 4px solid #3498db;
}

.counter-info h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.counter-info p {
    margin-bottom: 8px;
    color: #7f8c8d;
}

/* Odzivnost */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        flex-direction: column;
        text-align: center;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    nav {
        justify-content: center;
    }
    
    .counters-grid {
        grid-template-columns: 1fr;
    }
    
    .users-grid {
        grid-template-columns: 1fr;
    }
    
    .user-actions {
        flex-direction: column;
    }
    
    .user-actions .btn {
        width: 100%;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
    
    .form-large {
        max-width: 100%;
    }
    
    .counters-table th,
    .counters-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .counter-description {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .counters-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .history-table th,
    .history-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 20px;
        margin: 10px;
    }
    
    .counter-card {
        padding: 20px;
    }
    
    .user-card {
        padding: 20px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Animacije */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.counter-card,
.user-card,
.login-box {
    animation: fadeIn 0.5s ease-out;
}

/* Hover efekti */
.counter-card:hover,
.user-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Fokus stanja */
.form-group input:focus,
.form-group select:focus {
    transform: scale(1.02);
}

/* Loading stanje */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Skrivanje elementov */
.hidden {
    display: none !important;
}

/* Seznam števcev v modalu */
.counters-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: #f9f9f9;
    margin-top: 10px;
}

.counters-list::-webkit-scrollbar {
    width: 8px;
}

.counters-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.counters-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.counters-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Firefox scrollbar */
.counters-list {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Table Styles for pregled.php */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.counters-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.counters-table th,
.counters-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.counters-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.counters-table tr:hover {
    background-color: #f8f9fa;
}

.counters-table tr:last-child td {
    border-bottom: none;
}

.counter-name {
    font-weight: 600;
    color: #2c3e50;
}

.counter-description {
    color: #7f8c8d;
    font-size: 0.9em;
}

.reading-value {
    font-weight: 600;
    color: #2c3e50;
}

.reading-date {
    color: #7f8c8d;
    font-size: 0.9em;
}

.difference {
    font-weight: 600;
}

.difference.positive {
    color: #28a745;
}

.difference.negative {
    color: #dc3545;
}

.no-data {
    color: #6c757d;
    font-style: italic;
}

.section-header {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    font-size: 16px;
}

/* History page styles */
.filter-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.filter-form {
    max-width: 400px;
}

.stats-section {
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #ecf0f1;
    text-align: center;
}

.stat-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin: 0;
}

.counters-overview {
    margin-bottom: 30px;
}

.counters-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.counter-stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #ecf0f1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.counter-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.counter-stat-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.counter-stat-card .counter-description {
    color: #7f8c8d;
    margin-bottom: 15px;
    font-style: italic;
}

.counter-stat-card .counter-stats {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #3498db;
}

.counter-stat-card .counter-stats p {
    margin-bottom: 8px;
    color: #7f8c8d;
}

.history-section {
    margin-bottom: 30px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.history-table th,
.history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.history-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.history-table tr:hover {
    background-color: #f8f9fa;
}

.history-table tr:last-child td {
    border-bottom: none;
}

.user-name {
    color: #7f8c8d;
    font-size: 0.9em;
} 