/**
 * Art on Tour
 * Name: Arthur Peter Lorenzen
 * Adresse: Bachtelstrasse 68, 8342 Wernetshausen, Schweiz
 * E-Mail: info@art-on-tour.ch
 * Web: www.art-on-tour.ch
 */

/* ======================================= */
/*   1. ADMIN GRUNDLAGEN                   */
/* ======================================= */

/* 1.1 Reset & Grundlegendes */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
    color: #333;
}

/* 1.2 Admin-Container */
.container,
.admin-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 25px; /* 25px Abstand zu den Seitenrändern */
    margin-top: 70px; /* Platz für den fixen Header */
}

/* 1.3 Typische Elemente */
h2 {
    color: #8b0000;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 1.5rem;
}

h3 {
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

h4 {
    color: #555;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* ======================================= */
/*   2. ADMIN HEADER & NAVIGATION          */
/* ======================================= */

/* 2.1 Roter Header-Balken */
.admin-header {
    background-color: #8b0000;
    color: white;
    padding: 15px 25px; /* 25px Abstand zu den Seitenrändern */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

/* 2.2 Header-Container */
.admin-header .container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 0; /* Zurücksetzen des Standard-Abstands */
    padding: 0; /* Container im Header benötigt keinen Padding */
}

/* 2.3 Logo */
.admin-logo img {
    height: 40px;
}

/* 2.4 Zentrierter Titel (Admin Menü) */
.header-title,
.admin-menu-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.3rem;
    font-weight: normal;
    color: white;
    white-space: nowrap;
    margin: 0;
}

/* 2.5 Hamburger-Button */
.mobile-nav-toggle {
    background: none;
    border: 2px solid #fff;
    border-radius: 4px;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    margin-left: auto; /* Drückt den Button nach rechts */
    padding: 2px 8px;
}

/* 2.6 Admin-Navigation */
.admin-nav-center {
    text-align: right;
    position: relative;
}

#admin-nav-list {
    display: none;
    position: absolute;
    top: 60px;
    right: 10px;
    width: 220px;
    background-color: #fff;
    border: 2px solid #8b0000;
    border-radius: 10px;
    padding: 10px;
    z-index: 999;
    list-style: none;
}

#admin-nav-list.active {
    display: block;
}

#admin-nav-list li {
    margin: 0;
    padding: 0;
    margin-bottom: 5px;
}

#admin-nav-list li a {
    display: block;
    color: #333;
    text-decoration: none;
    font-weight: normal;
    padding: 5px 12px;
    border-radius: 10px;
    transition: 0.2s;
    white-space: nowrap;
}

#admin-nav-list li a:hover {
    border-top: 1px solid #8b0000;
    border-bottom: 1px solid #8b0000;
    color: #8b0000;
}

#admin-nav-list li a.active {
    border: 1px solid #8b0000;
    background-color: #f9f9f9;
    color: #8b0000;
}

/* 2.7 Abmelden-Button */
#admin-nav-list li a.btn.btn-secondary {
    background-color: #8b0000 !important;
    color: #fff !important;
    border: none !important;
}

#admin-nav-list li a.btn.btn-secondary:hover {
    background-color: #a50000 !important;
}

/* ======================================= */
/*   3. PANELS, BUTTONS & ELEMENTE         */
/* ======================================= */

/* 3.1 Panel-Grundstruktur */
.panel, .welcome-panel {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 25px;
}

/* 3.2 Buttons */
.btn {
    display: inline-block;
    padding: 10px 16px;
    background-color: #8b0000;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    background-color: #a50000;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-decoration: none;
    color: white;
}

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

/* 3.3 Button-Varianten */
.btn-secondary {
    background-color: #666;
}

.btn-secondary:hover {
    background-color: #777;
}

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

/* 3.4 Meldungen (Erfolg, Fehler, Info, etc.) */
.message, .success-message, .error-message {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.success-message, .message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message, .message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.info-message, .message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.warning-message, .message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* 3.5 Tabellen */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: white;
}

table th, table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

table th {
    background-color: #f5f5f5;
    font-weight: bold;
    color: #333;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #f0f0f0;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ======================================= */
/*   4. FORMULARE                          */
/* ======================================= */

/* 4.1 Formulare */
form {
    margin: 0;
}

.form-group {
    margin-bottom: 18px;
}

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

/* 4.2 Eingabefelder */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #8b0000;
    outline: none;
    box-shadow: 0 0 3px rgba(139, 0, 0, 0.2);
}

/* 4.3 Checkbox und Radio */
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    margin-right: 5px;
}

/* 4.4 Formular-Aktionen */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* 4.5 Zweispaltig (falls gewünscht) */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.form-group.half {
    flex: 0 0 calc(50% - 20px);
    margin: 0 10px 18px;
}

/* ======================================= */
/*   5. GRID LAYOUTS & PREVIEW             */
/* ======================================= */

/* 5.1 Bilder-Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.image-item {
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    background-color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.image-preview {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-info {
    padding: 12px;
}

.image-name {
    margin: 0 0 5px 0;
    font-weight: bold;
    word-break: break-all;
    font-size: 0.9rem;
}

.image-meta {
    margin: 0 0 5px 0;
    font-size: 0.8rem;
    color: #666;
}

.image-used {
    margin: 0;
    font-size: 0.8rem;
    color: #28a745;
}

.delete-btn {
    margin-top: 8px;
}

.image-preview-container {
    width: 100%;
    max-width: 300px;
    height: 150px;
    margin: 10px 0;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 10px;
}

.no-image {
    color: #999;
    text-align: center;
    font-style: italic;
}

/* 5.2 Property-Preview */
.property-preview {
    margin-top: 20px;
    background-color: #f5f5f5;
    border-radius: 10px;
    padding: 20px;
}

.property-preview-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.property-preview-header {
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.property-preview-header h4 {
    margin: 0;
    color: #8b0000;
    font-size: 1.3rem;
}

.property-preview-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.preview-info-item {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px;
    transition: background-color 0.2s;
}

.preview-info-item:hover {
    background-color: #f9f9f9;
}

.preview-info-label {
    display: block;
    font-weight: bold;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.preview-info-value {
    display: block;
    font-size: 1.1rem;
    color: #333;
}

.property-preview-description,
.property-preview-features,
.property-preview-location {
    margin-bottom: 20px;
}

.property-preview-description h5,
.property-preview-features h5,
.property-preview-location h5 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.property-preview-description p,
.property-preview-location p {
    line-height: 1.6;
    color: #333;
}

.preview-features-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.preview-features-list li {
    position: relative;
    padding-left: 25px;
    line-height: 1.6;
}

.preview-features-list li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #8b0000;
}

/* 5.3 Kontakt-Preview */
.contact-preview {
    margin-top: 20px;
    background-color: #f5f5f5;
    border-radius: 10px;
    padding: 20px;
}

.contact-card {
    display: flex;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 5.4 Footer Styling */
.footer {
    margin-top: 40px;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid #eee;
}

.footer-content {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.footer a {
    color: #8b0000;
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: #a50000;
    text-decoration: none;
}

.contact-image-preview {
    width: 150px;
    height: 150px;
    overflow: hidden;
    flex-shrink: 0;
}

.contact-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-details-preview {
    padding: 20px;
    flex-grow: 1;
}

.contact-details-preview h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.2rem;
}

.contact-details-preview p {
    margin: 8px 0;
    color: #666;
}

.contact-details-preview p.company {
    font-weight: bold;
    color: #8b0000;
    margin-bottom: 15px;
}

.contact-details-preview a {
    color: #8b0000;
    text-decoration: none;
}

.contact-details-preview a:hover {
    text-decoration: underline;
}

/* ======================================= */
/*   6. SONDERMODULE & EXTRAS             */
/* ======================================= */

/* 6.1 Upload-Dialog */
.upload-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.upload-dialog-content {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}

.close-dialog {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.close-dialog:hover {
    color: #8b0000;
}

.upload-progress {
    margin: 15px 0;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #8b0000;
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    text-align: center;
    margin-top: 5px;
    font-size: 14px;
}

/* 6.2 Feature-Row */
.feature-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 10px;
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 10px;
    border: 1px solid #eee;
}

.feature-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* 6.3 Dashboard-Style */
.dashboard-section {
    margin-bottom: 30px;
}

.dashboard-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.dashboard-tile {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dashboard-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.dashboard-tile h3 {
    color: #8b0000;
    margin-top: 0;
    margin-bottom: 10px;
}

.dashboard-tile p {
    margin-bottom: 0;
    color: #666;
    flex-grow: 1;
}

.dashboard-tile-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    color: rgba(139, 0, 0, 0.1);
    font-size: 24px;
}

.dashboard-tile-new {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #8b0000;
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 0 0 0 5px;
}

/* ======================================= */
/*   7. LOGIN PAGE                         */
/* ======================================= */

/* 7.1 Login-spezifische Stile */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    margin-top: 0 !important; /* Überschreibt den Standard-Abstand */
    background-color: #f5f5f5;
}

.login-container {
    max-width: 400px;
    width: 100%;
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.login-title {
    color: #8b0000;
    margin-bottom: 30px;
    font-size: 1.8rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

.login-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: left;
}

.login-form {
    text-align: left;
}

.login-form .form-group {
    margin-bottom: 25px;
}

.login-form label {
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
    color: #333;
}

.login-form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.login-form input[type="password"]:focus {
    border-color: #8b0000;
    outline: none;
    box-shadow: 0 0 5px rgba(139, 0, 0, 0.2);
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    background-color: #8b0000;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-btn:hover {
    background-color: #a50000;
}

/* ======================================= */
/*   8. RESPONSIVE DESIGN                  */
/* ======================================= */

/* 7.1 Desktop & Tablet */
@media (max-width: 992px) {
    /* 7.1.1 Container */
    .container,
    .admin-container {
        padding: 15px 20px; /* Reduzierter seitlicher Abstand */
        margin-top: 65px;
    }
    
    /* 7.1.2 Header */
    .admin-header {
        padding: 12px 20px;
    }
    
    .header-title,
    .admin-menu-label {
        font-size: 1.2rem;
    }
    
    .admin-logo img {
        height: 35px;
    }
    
    /* 7.1.3 Panels */
    .panel, .welcome-panel {
        padding: 15px;
    }
    
    .feature-row {
        flex-direction: column;
    }
    
    /* 7.1.4 Dashboard */
    .dashboard-tiles {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    /* 7.1.5 Rundungen anpassen */
    .btn,
    .panel,
    .welcome-panel,
    .message,
    .success-message,
    .error-message,
    .info-message,
    .warning-message,
    .form-group input,
    .form-group select,
    .form-group textarea,
    .image-item,
    .image-preview-container,
    .property-preview,
    .property-preview-card,
    .preview-info-item,
    .upload-dialog-content,
    .feature-row,
    .dashboard-tile,
    #admin-nav-list,
    #admin-nav-list li a {
        border-radius: 8px;
    }
}

/* 7.2 Mobile Landscape */
@media (max-width: 768px) {
    /* 7.2.1 Container */
    .container,
    .admin-container {
        padding: 10px 15px;
        margin-top: 55px;
    }
    
    /* 7.2.2 Header */
    .admin-header {
        padding: 10px 15px;
    }
    
    .header-title,
    .admin-menu-label {
        font-size: 1.1rem;
        max-width: 60%; /* Verhindert Überlappungen */
    }
    
    .admin-logo img {
        height: 30px;
    }
    
    .mobile-nav-toggle {
        font-size: 20px;
        padding: 1px 6px;
    }
    
    /* 7.2.3 Formulare */
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button,
    .form-actions a {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .form-row {
        margin: 0;
    }
    
    .form-group.half {
        flex: 0 0 100%;
        margin: 0 0 15px;
    }
    
    /* 7.2.4 Grids */
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .property-preview-info-grid,
    .preview-features-list {
        grid-template-columns: 1fr;
    }
    
    /* 7.2.5 Kontakt-Preview */
    .contact-card {
        flex-direction: column;
    }
    
    .contact-image-preview {
        width: 100%;
        height: 200px;
    }
    
    /* 7.2.6 Dashboard */
    .dashboard-tiles {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}

/* 7.3 Mobile Portrait */
@media (max-width: 480px) {
    /* 7.3.1 Container */
    .container,
    .admin-container {
        padding: 10px 10px; /* 10px Abstand zu den Seiten auf Mobilgeräten */
        margin-top: 50px;
    }
    
    /* 7.3.2 Header */
    .admin-header {
        padding: 8px 10px;
    }
    
    .header-title,
    .admin-menu-label {
        font-size: 1rem;
        max-width: 50%;
    }
    
    /* 7.3.3 Typografie */
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    /* 7.3.4 Panels und Elemente */
    .panel, .welcome-panel {
        padding: 12px;
    }
    
    /* 7.3.5 Grids */
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .dashboard-tiles {
        grid-template-columns: 1fr;
    }
    
    /* 7.3.6 Upload Dialog */
    .upload-dialog-content {
        padding: 15px;
    }
    
    /* 7.3.7 Rundungen anpassen */
    .btn,
    .panel,
    .welcome-panel,
    .message,
    .success-message,
    .error-message,
    .info-message,
    .warning-message,
    .form-group input,
    .form-group select,
    .form-group textarea,
    .image-item,
    .image-preview-container,
    .property-preview,
    .property-preview-card,
    .preview-info-item,
    .upload-dialog-content,
    .feature-row,
    .dashboard-tile,
    #admin-nav-list,
    #admin-nav-list li a {
        border-radius: 6px;
    }
}
/* Verbesserte Footer-Vorschau */
.real-footer-preview {
    margin: 20px 0;
    padding: 0;
}

.preview-frame {
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.viewport-simulation {
    width: 100%;
    height: 100px; /* Höhe des typischen Footers */
    position: relative;
    overflow: hidden;
    background-color: #f9f9f9;
}

.footer-container {
    position: relative;
    bottom: 0;
    width: 100%;
    height: auto;
    background-color: #fff;
    border-top: 3px solid #8b0000;
    padding: 10px 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

/* Footer-Menüpunkt-Styling */
.footer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px;
    text-decoration: none;
    max-width: 70px;
    text-align: center;
}

.footer-icon {
    width: 24px;
    height: 24px;
    color: #8b0000;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-label {
    font-size: 12px;
    color: #333;
    line-height: 1.2;
}

.footer-item.active .footer-icon {
    color: rgb(139, 0, 0);
}

.footer-item.active .footer-label {
    font-weight: 500;
}

.submenu-indicator {
    font-size: 8px !important;
    margin-top: 2px;
    color: #666;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .viewport-simulation {
        height: 120px; /* Mehr Platz für mobile Ansicht */
    }
    
    .footer-container {
        flex-wrap: wrap;
    }
    
    .footer-item {
        margin: 0 5px;
    }
}
