/* style.css - Globálne štýly pre MojCloud */

/* Reset a základné štýly */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Navigačný panel */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

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

.navbar-user span {
    opacity: 0.9;
}

.navbar-user a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    background: rgba(255,255,255,0.2);
    transition: background 0.3s;
}

.navbar-user a:hover {
    background: rgba(255,255,255,0.3);
}

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

.container-narrow {
    max-width: 800px;
}

.container-wide {
    max-width: 1400px;
}

/* Stránkové hlavičky */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    color: #333;
    font-size: 28px;
}

/* Tlačidlá */
.btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn:hover {
    background: #5568d3;
    color: white; /* KRITICKÉ: Explicitne nastavenie farby textu pri hover */
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    text-decoration: none; /* Zabraň podčiarknutiu ako pri linkoch */
}

.btn:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

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

.btn-secondary:hover {
    background: #7f8c8d;
    color: white; /* KRITICKÉ: Explicitne nastavenie */
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    color: white; /* KRITICKÉ: Explicitne nastavenie */
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
    color: white; /* KRITICKÉ: Explicitne nastavenie */
}

.btn-full {
    width: 100%;
}

/* Špeciálna úprava pre linky so štýlom tlačidiel */
a.btn {
    color: white !important; /* Prepiš link štýly */
}

a.btn:hover {
    color: white !important; /* Zachovaj biely text pri hover */
    text-decoration: none !important;
}

/* Akcie zariadení - opravené */
.device-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.device-actions a.btn,
.device-actions button.btn {
    color: white;
}

.device-actions a.btn:hover,
.device-actions button.btn:hover {
    color: white;
}

/* Karty */
.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.card h2 {
    color: #333;
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.card h3 {
    color: #555;
    font-size: 18px;
    margin-bottom: 15px;
}

/* Grid zariadení */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.device-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.device-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.device-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.device-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.device-uid {
    font-size: 12px;
    color: #999;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
}

.device-stats {
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.stat:last-child {
    margin-bottom: 0;
}

.stat-label {
    color: #666;
}

.stat-value {
    font-weight: 600;
    color: #333;
}

.device-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

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

.stat-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #667eea;
    transition: transform 0.2s;
}

.stat-box:hover {
    transform: translateY(-3px);
}

.stat-box-value {
    font-size: 36px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-box-label {
    font-size: 14px;
    color: #666;
}

/* Formuláre */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input[disabled],
.form-group select[disabled] {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
}

/* Tabuľky */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: #f8f9fa;
}

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    font-size: 14px;
}

td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
    font-size: 14px;
}

tr:hover {
    background: #f8f9fa;
}

/* Taby */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.tab:hover {
    color: #667eea;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Modály */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    animation: slideDown 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #333;
    margin: 0;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #000;
}

/* Prázdny stav */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h2 {
    color: #666;
    margin-bottom: 10px;
    font-size: 22px;
}

.empty-state p {
    color: #999;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Správy */
.error,
.alert-error {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #c33;
}

.success,
.alert-success {
    background: #efe;
    color: #2a2;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #2a2;
}

.info,
.alert-info {
    background: #def;
    color: #246;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #246;
}

.warning,
.alert-warning {
    background: #ffeaa7;
    color: #856404;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #856404;
}

/* Linky */
.back-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 500;
    transition: color 0.3s;
}

.back-link:hover {
    color: #5568d3;
    text-decoration: underline;
}

a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #5568d3;
}

/* Info riadky */
.info-row {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    flex: 0 0 200px;
    font-weight: 600;
    color: #666;
}

.info-value {
    flex: 1;
    color: #333;
}

/* Graf container */
.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 20px;
}

/* Login/Register stránky */
.login-container,
.register-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    color: #667eea;
    font-size: 32px;
    margin-bottom: 5px;
}

.logo p {
    color: #666;
    font-size: 14px;
}

.login-link,
.register-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

.login-link a,
.register-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.login-link a:hover,
.register-link a:hover {
    text-decoration: underline;
}

/* Session timeout notice */
.session-notice {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #fff3cd;
    color: #856404;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 999;
    display: none;
    animation: slideInRight 0.3s;
}

.session-notice.show {
    display: block;
}

/* Animácie */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Responzívny dizajn */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .navbar-user {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .devices-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .info-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .info-label {
        flex: none;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
    
    .device-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .card {
        padding: 15px;
    }
    
    .navbar {
        padding: 10px 15px;
    }
    
    .navbar-brand {
        font-size: 20px;
    }
    
    .page-header h1 {
        font-size: 22px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .filter-bar,
    .tabs,
    .device-actions {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        page-break-inside: avoid;
    }
}

/* Admin badge */
.badge-admin {
    display: inline-block;
    padding: 2px 8px;
    background: #e74c3c;
    color: white;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 5px;
}