/* TerminTool Form & Table Styles - Works with Explere Design */

/* Page Hero Section */
.page-hero {
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.8) 0%, rgba(52, 73, 94, 0.8) 100%), 
                url('/static/images/hero_image.png') center/cover no-repeat;
    padding: 6rem 0 4rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    min-height: 300px;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.page-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Main Content Container */
.main-content {
    min-height: calc(100vh - 400px);
    padding: 2rem 0 4rem;
}

/* Forms - Compatible with existing Flask forms */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group .required {
    color: #e74c3c;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: 'DM Sans', sans-serif;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Buttons */
.btn,
button[type="submit"],
input[type="submit"] {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: 'DM Sans', sans-serif;
}

.btn:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
    background: #34495e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-secondary {
    background: #95a5a6;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #229954;
}

/* Tables - Mobile responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid #e9ecef;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #f1f3f5;
}

tr:hover {
    background: #f8f9fa;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #2c3e50;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}

.toast.warning {
    background: #f39c12;
}

.toast.hide {
    animation: slideOut 0.3s ease;
    opacity: 0;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .page-hero {
        padding: 4rem 0 3rem;
        min-height: 250px;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .form-container {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Make forms more touch-friendly on mobile */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="date"],
    input[type="datetime-local"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 1rem;
    }
}

/* Cards for content sections */
.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.card-header {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f1f3f5;
}

/* Action buttons in tables */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Form row for side-by-side fields */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Checkbox and radio styles */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin-right: 0.5rem;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

/* File upload styling */
input[type="file"] {
    padding: 0.5rem;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 8px;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: #3498db;
    background: #f1f8ff;
}

/* Navigation adjustments for TerminTool */
.main-header .nav-menu > li > a {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.main-header .nav-menu > li > a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.main-header .dropdown-menu {
    min-width: 200px;
}

.main-header .dropdown-menu a {
    padding: 0.75rem 1rem;
}

.main-header .dropdown-menu i {
    width: 20px;
    margin-right: 0.5rem;
}

/* Mobile Optimizations for Mietinteressenten */
@media (max-width: 768px) {
    /* Center filter section on mobile */
    .filter-section {
        padding: 1rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .filter-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        max-width: 400px;
    }
    
    .search-section {
        width: 100%;
        max-width: 400px;
        display: flex;
        justify-content: center;
    }
    
    .search-wrapper {
        width: 100%;
    }
    
    /* Center mobile cards container */
    .mobile-card-section {
        padding: 0 1rem;
    }
    
    .mi-cards-grid {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .objekte-cards-grid,
    .eigentuemer-cards-grid {
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* Ensure cards are full width on small screens */
    .mi-card-mobile,
    .objekt-card-mobile,
    .eigentuemer-card-mobile {
        width: 100%;
        margin-bottom: 1rem;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        overflow: hidden;
    }
    
    /* Card Header Styles */
    .card-header-mobile {
        padding: 1rem;
        background: #f8f9fa;
        border-bottom: 1px solid #e9ecef;
    }
    
    .header-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* Tag Styles */
    .tag {
        display: inline-block;
        padding: 0.25rem 0.5rem;
        background: #007bff;
        color: white;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 500;
    }
    
    .tag-objekt { background: #007bff; }
    .tag-wohnung { background: #28a745; }
    .tag-firma { background: #fd7e14; }
    .tag-person { background: #6f42c1; }
    
    /* Card Content */
    .card-content-mobile {
        padding: 1rem;
    }
    
    .address-section,
    .name-section {
        margin-bottom: 1rem;
    }
    
    .address-title,
    .name-title {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 0.25rem;
        color: #2c3e50;
    }
    
    .address-subtitle {
        color: #7f8c8d;
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .etage-info,
    .contact-person {
        color: #7f8c8d;
        font-size: 0.8rem;
    }
    
    /* Owner/Contact Sections */
    .owner-section,
    .contact-section {
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .owner-section i {
        color: #007bff;
        margin-top: 0.25rem;
    }
    
    .owner-details {
        flex: 1;
    }
    
    .owner-label {
        display: block;
        font-size: 0.8rem;
        color: #7f8c8d;
        margin-bottom: 0.25rem;
    }
    
    /* Contact Items */
    .contact-item-mobile {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .contact-item-mobile i {
        color: #007bff;
        width: 16px;
    }
    
    .contact-link {
        color: #007bff;
        text-decoration: none;
        font-size: 0.9rem;
    }
    
    .contact-link:hover {
        text-decoration: underline;
    }
    
    /* Card Actions */
    .card-actions-mobile {
        padding: 1rem;
        background: #f8f9fa;
        border-top: 1px solid #e9ecef;
    }
    
    .action-buttons-mobile {
        display: flex;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .btn-mobile {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: none;
        font-size: 1rem;
        text-decoration: none;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .btn-info { background: #17a2b8; color: white; }
    .btn-edit { background: #007bff; color: white; }
    .btn-delete { background: #dc3545; color: white; }
    
    .btn-mobile:hover {
        transform: scale(1.05);
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }
    
    /* Action Section Centering */
    .action-section {
        text-align: center;
        padding: 1rem;
    }
    
    .action-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    
    /* Hide desktop view on mobile */
    .desktop-view {
        display: none;
    }
    
    /* Show mobile view only on mobile */
    .mobile-view {
        display: block;
    }
}

/* Desktop view - hide mobile on desktop */
@media (min-width: 769px) {
    .mobile-view {
        display: none;
    }
    
    .desktop-view {
        display: block;
    }
}
