/* Weather App Theme Variables */
:root {
    /* Weather App Colors */
    --weather-primary: #3b82f6;
    --weather-secondary: #1e40af;
    --weather-accent: #60a5fa;
    --weather-bg: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #3730a3 100%);
    --weather-card-bg: rgba(255, 255, 255, 0.1);
    --weather-text: #ffffff;
    --weather-text-muted: #cbd5e1;
    --weather-border: rgba(255, 255, 255, 0.2);
    
    /* Mr. Robot Hacker Theme - Verde Fosforescente */
    --primary-bg: #0d0d0d;
    --secondary-bg: #1a1a1a;
    --accent-bg: #0d1421;
    --text-primary: #00ff88;
    --terminal-green: #00ff88;
    --text-secondary: #ffffff;
    --text-muted: #40ff88;
    --border-color: #00ff88;
    --success-color: #00ff88;
    --warning-color: #ff6b35;
    --error-color: #ff3838;
    --terminal-font: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    
    /* Effetti glow ridotti */
    --green-glow: 0 0 3px #00ff88;
    --green-text-shadow: 0 0 2px #00ff88;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--weather-bg);
    font-family: 'Arial', sans-serif;
    color: var(--weather-text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Admin Panel Theme Override - Mr. Robot Style */
body.admin-mode {
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #0d1421 100%);
    font-family: var(--terminal-font);
    color: var(--terminal-green);
}

/* Rimozione effetto CRT scanlines */


/* Mr. Robot Terminal Animations */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes flicker {
    0%, 90% { opacity: 1; }
    95% { opacity: 0.1; }
    100% { opacity: 1; }
}

@keyframes glow-pulse {
    0% { box-shadow: 0 0 5px rgba(0, 255, 136, 0.2); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 136, 0.6); }
    100% { box-shadow: 0 0 5px rgba(0, 255, 136, 0.2); }
}

/* Terminal cursor effect */
.terminal-cursor::after {
    content: '_';
    color: var(--terminal-green);
    animation: blink 1s infinite;
}

/* Rimosse animazioni eccessive */

/* Terminal-style code and pre blocks */
pre, code {
    background: var(--primary-bg) !important;
    color: var(--terminal-green) !important;
    border: 1px solid var(--border-color) !important;
    font-family: var(--terminal-font) !important;
}

/* Matrix rain effect for special elements */
.matrix-bg {
    position: relative;
    overflow: hidden;
}

.matrix-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 255, 136, 0.1) 50%, transparent 100%);
    animation: matrix-scan 3s linear infinite;
}

@keyframes matrix-scan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
}

/* Header styling - Mr. Robot Style */
.app-header {
    background: var(--secondary-bg);
    border-bottom: 2px solid var(--text-primary);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 0 var(--terminal-green);
}

.app-title {
    color: var(--text-primary);
    font-size: 1.8rem;
    text-shadow: var(--green-text-shadow);
    font-weight: bold;
    letter-spacing: 1px;
    margin: 0;
}

.app-title .icon {
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Navigation tabs */
.nav-tabs {
    background: var(--accent-bg);
    border: none;
    border-radius: 0;
    margin: 0;
}

.nav-tabs .nav-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    font-family: var(--terminal-font);
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    background: rgba(0, 255, 136, 0.1);
    text-shadow: var(--green-text-shadow);
    box-shadow: inset 0 0 10px rgba(0, 255, 136, 0.2);
}

.nav-tabs .nav-link.active {
    color: var(--text-primary);
    background: var(--primary-bg);
    border-bottom: 3px solid var(--text-primary);
    text-shadow: var(--green-text-shadow);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.nav-tabs .nav-link.active::before {
    content: '> ';
    color: var(--text-primary);
    text-shadow: var(--green-text-shadow);
}

/* Containers and cards */
.container-fluid {
    padding: 0;
}

.tab-content {
    background: var(--primary-bg);
    min-height: calc(100vh - 150px);
    padding: 2rem;
}

.card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.card-header {
    background: var(--accent-bg);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: bold;
}

/* Buttons */
.btn {
    font-family: var(--terminal-font);
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary {
    background: linear-gradient(45deg, var(--text-primary), #00cc6a);
    border: none;
    color: var(--primary-bg);
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(45deg, var(--success-color), #00cc6a);
    border: none;
    color: var(--primary-bg);
}

.btn-warning {
    background: linear-gradient(45deg, var(--warning-color), #ff8c42);
    border: none;
    color: var(--primary-bg);
}

.btn-danger {
    background: linear-gradient(45deg, var(--error-color), #ff5555);
    border: none;
    color: var(--primary-bg);
}

.btn-secondary {
    background: var(--accent-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.btn-outline-secondary:hover {
    background: var(--accent-bg);
    color: var(--text-primary);
}

/* Tables */
.table {
    color: var(--text-secondary);
    background: transparent;
}

.table th {
    background: var(--accent-bg);
    color: var(--text-primary);
    border: none;
    padding: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table td {
    border: none;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr {
    transition: background 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(0, 255, 136, 0.05);
}

/* Forms */
.form-control, .form-select {
    background: var(--accent-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--terminal-font);
}

.form-control:focus, .form-select:focus {
    background: var(--accent-bg);
    border-color: var(--text-primary);
    color: var(--text-secondary);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.form-label {
    color: var(--text-primary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.form-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Terminal-style elements */
.terminal {
    background: #000;
    color: var(--text-primary);
    font-family: var(--terminal-font);
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid var(--text-primary);
    white-space: pre-wrap;
    overflow-x: auto;
    position: relative;
}

.terminal::before {
    content: '$ ';
    color: var(--text-primary);
}

/* Status indicators */
.status-running {
    color: var(--success-color);
    animation: blink 1.5s infinite;
}

.status-stopped, .status-exited {
    color: var(--error-color);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

/* Breadcrumbs */
.breadcrumb {
    background: var(--accent-bg);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.breadcrumb-item {
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text-primary);
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--text-primary);
}

/* Icons and animations */
.file-icon {
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
}

.clickable:hover .file-icon {
    transform: scale(1.2);
}

.clickable {
    cursor: pointer;
    transition: color 0.2s ease;
}

.clickable:hover {
    color: var(--text-primary);
}

/* Modal styling */
.modal-content {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    color: var(--text-primary);
}

.btn-close {
    filter: invert(1);
}

/* Toast notifications */
.toast {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.toast-header {
    background: var(--accent-bg);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Loading animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--text-primary);
    animation: spin 1s ease-in-out infinite;
}

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

/* File manager specific */
.file-list-container {
    background: var(--secondary-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.file-actions {
    display: flex;
    gap: 0.25rem;
}

/* Wizard panel styling */
.wizard-panel {
    background: var(--secondary-bg);
    border-radius: 8px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.wizard-title {
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--text-primary);
    margin-bottom: 1rem;
}

/* Results specific styling */
.result-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.15);
}

.result-card img {
    transition: transform 0.3s ease;
}

.result-card:hover img {
    transform: scale(1.05);
}

#imagePreviewModal .modal-content {
    background: var(--secondary-bg);
}

#imagePreviewModal .modal-body img {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.pagination .page-link {
    background: var(--accent-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.pagination .page-link:hover {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--primary-bg);
}

.pagination .page-item.active .page-link {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--primary-bg);
}

.pagination .page-item.disabled .page-link {
    background: var(--secondary-bg);
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* Login Modal Styling */
#loginModal .modal-content {
    background: var(--secondary-bg);
    border: 2px solid var(--terminal-green);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
}

#loginModal .login-logo i {
    text-shadow: 0 0 20px var(--terminal-green);
    animation: pulse 2s infinite;
}

#loginModal .form-control-lg {
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

#loginModal .form-control-lg:focus {
    border-color: var(--terminal-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

#loginModal .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Enhanced Mobile/Tablet Responsive Design */
@media (max-width: 1200px) {
    .app-header {
        padding: 1rem 1.5rem;
    }
    
    .app-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 992px) {
    .nav-tabs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tabs .nav-link {
        display: inline-block;
        min-width: 120px;
        text-align: center;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .file-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .file-actions .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .app-title {
        font-size: 1.3rem;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
        min-width: 100px;
    }
    
    .result-card {
        margin-bottom: 1rem;
    }
    
    .modal-dialog {
        margin: 1rem;
    }
    
    .wizard-panel {
        padding: 1rem;
    }
    
    .card-header {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .nav-tabs .nav-link {
        padding: 0.5rem 0.25rem;
        font-size: 0.7rem;
        min-width: 80px;
    }
    
    .app-title {
        font-size: 1.1rem;
    }
    
    .card-body .row > div {
        margin-bottom: 1rem;
    }
    
    .file-list-container {
        overflow-x: auto;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .file-actions .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .result-card .card-body {
        padding: 0.75rem;
    }
    
    .result-card .card-title {
        font-size: 0.9rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    #loginModal .modal-body {
        padding: 2rem 1.5rem;
    }
    
    #loginModal .form-control-lg {
        font-size: 1rem;
    }
}

/* Tablet-specific optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    .container-fluid {
        padding: 0 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .table th, .table td {
        padding: 0.5rem;
    }
    
    .wizard-panel {
        padding: 1.5rem;
    }
}

/* Touch-friendly buttons for mobile */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-tabs .nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .clickable {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .file-actions .btn {
        min-height: 40px;
    }
}

/* Dark mode specific enhancements */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* Print-friendly styles */
@media print {
    .nav-tabs,
    .app-header,
    .modal,
    .toast-container,
    .btn {
        display: none !important;
    }
    
    .tab-content {
        padding: 0;
        min-height: auto;
    }
    
    .card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* ==================== WEATHER APP STYLES ==================== */

/* Weather Header */
.weather-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--weather-border);
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.weather-title {
    color: var(--weather-text);
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.weather-title i {
    margin-right: 0.5rem;
    color: var(--weather-accent);
}

/* Weather Main Content */
.weather-main {
    padding: 2rem 0;
}

/* Weather Cards */
.current-weather-card,
.search-card,
.forecast-card {
    background: var(--weather-card-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--weather-border);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.current-weather-card:hover,
.search-card:hover,
.forecast-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Current Weather */
.location-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--weather-text);
    margin-bottom: 0.5rem;
}

.current-temp {
    font-size: 4rem;
    font-weight: 300;
    color: var(--weather-text);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.temp-unit {
    font-size: 2rem;
    opacity: 0.7;
}

.weather-description {
    font-size: 1.2rem;
    color: var(--weather-text-muted);
    text-transform: capitalize;
    margin-bottom: 1rem;
}

.weather-details {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.weather-details span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--weather-text-muted);
    font-size: 0.95rem;
}

.weather-details i {
    color: var(--weather-accent);
}

.weather-icon-large {
    font-size: 6rem;
    color: var(--weather-accent);
    opacity: 0.9;
}

/* Search Card */
.search-card h5 {
    color: var(--weather-text);
    margin-bottom: 1rem;
    font-weight: 600;
}

.search-card h5 i {
    color: var(--weather-accent);
    margin-right: 0.5rem;
}

.search-card .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--weather-border);
    color: var(--weather-text);
    border-radius: 10px 0 0 10px;
    padding: 0.75rem 1rem;
}

.search-card .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--weather-accent);
    color: var(--weather-text);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.search-card .form-control::placeholder {
    color: var(--weather-text-muted);
}

.search-card .btn-primary {
    background: linear-gradient(45deg, var(--weather-primary), var(--weather-accent));
    border: none;
    border-radius: 0 10px 10px 0;
    padding: 0.75rem 1.5rem;
    color: white;
    font-weight: 500;
}

.search-card .btn-primary:hover {
    background: linear-gradient(45deg, var(--weather-secondary), var(--weather-primary));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

/* Forecast Card */
.forecast-card h5 {
    color: var(--weather-text);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.forecast-card h5 i {
    color: var(--weather-accent);
    margin-right: 0.5rem;
}

.forecast-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.forecast-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.forecast-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.forecast-item .day {
    flex: 1;
    font-weight: 500;
    color: var(--weather-text);
}

.forecast-item i {
    flex: 0 0 auto;
    font-size: 1.5rem;
    color: var(--weather-accent);
    margin: 0 1rem;
}

.forecast-item .temps {
    flex: 1;
    text-align: right;
    color: var(--weather-text-muted);
    font-weight: 500;
}

/* Admin Login Modal Overrides */
#adminLoginModal .modal-content {
    background: var(--admin-secondary-bg);
    border: 2px solid var(--terminal-green);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
}

#adminLoginModal .login-logo i {
    text-shadow: 0 0 20px var(--terminal-green);
    animation: pulse 2s infinite;
}

#adminLoginModal .form-control-lg {
    background: var(--admin-accent-bg);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--terminal-font);
}

#adminLoginModal .form-control-lg:focus {
    border-color: var(--terminal-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
    background: var(--admin-accent-bg);
    color: var(--text-secondary);
}

/* Responsive Weather Design */
@media (max-width: 768px) {
    .weather-main {
        padding: 1rem 0;
    }
    
    .current-weather-card,
    .search-card,
    .forecast-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .current-temp {
        font-size: 3rem;
    }
    
    .weather-details {
        gap: 1rem;
    }
    
    .weather-icon-large {
        font-size: 4rem;
        margin-top: 1rem;
    }
    
    .location-name {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .current-weather-card,
    .search-card,
    .forecast-card {
        padding: 1rem;
        border-radius: 15px;
    }
    
    .current-temp {
        font-size: 2.5rem;
        text-align: center;
    }
    
    .weather-details {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .weather-details span {
        font-size: 0.9rem;
    }
    
    .forecast-item {
        padding: 0.75rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .forecast-item .day,
    .forecast-item .temps {
        flex: none;
    }
    
    .forecast-item i {
        margin: 0.5rem 0;
    }
}