/**
 * INWX Domain Manager - Stylesheet
 * Modernes und benutzerfreundliches Design
 */

/* ===================================
   GRUNDLEGENDES STYLING
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* ===================================
   HEADER
   =================================== */

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

header .subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* ===================================
   ALERTS / MELDUNGEN
   =================================== */

.alert {
    padding: 15px 20px;
    margin: 20px;
    border-radius: 8px;
    border-left: 5px solid;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.alert h3 {
    margin-bottom: 10px;
    font-size: 1.2em;
}

.alert ul {
    margin-left: 20px;
    margin-top: 10px;
}

.alert code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* ===================================
   CARDS
   =================================== */

.card {
    margin: 20px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

/* ===================================
   ACCOUNT INFO
   =================================== */

.account-info {
    background: #e7f3ff;
    padding: 15px 20px;
    margin: 20px;
    border-radius: 8px;
    border-left: 5px solid #17a2b8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.account-info strong {
    color: #0c5460;
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8d 100%);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.9em;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.2em;
}

/* ===================================
   DOMAIN GRID
   =================================== */

.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.domain-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.domain-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
    transform: translateY(-3px);
}

.domain-card.active {
    border-color: #28a745;
    background: #f0fff4;
}

.domain-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.domain-header h3 {
    color: #333;
    font-size: 1.3em;
    margin: 0;
    word-break: break-all;
}

.domain-status {
    font-size: 1.5em;
}

.domain-info {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.domain-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.domain-actions .btn {
    flex: 1;
    min-width: 140px;
}

/* ===================================
   TABELLEN
   =================================== */

.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

.dns-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.dns-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.dns-table th,
.dns-table td {
    padding: 12px 15px;
    text-align: left;
}

.dns-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

.dns-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s ease;
}

.dns-table tbody tr:hover {
    background: #f8f9fa;
}

.dns-table tbody tr:last-child {
    border-bottom: none;
}

.record-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85em;
    background: #667eea;
    color: white;
}

.content-cell {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #495057;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-count {
    margin-top: 15px;
    padding: 10px;
    background: #e7f3ff;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    color: #0c5460;
}

/* ===================================
   FORMULARE
   =================================== */

.create-record-form,
.standard-records-preview {
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.create-record-form summary,
.standard-records-preview summary {
    font-weight: 600;
    font-size: 1.1em;
    color: #667eea;
    cursor: pointer;
    padding: 10px;
    margin: -20px -20px 20px -20px;
    background: #f0f4ff;
    border-radius: 6px 6px 0 0;
    transition: background 0.2s ease;
}

.create-record-form summary:hover,
.standard-records-preview summary:hover {
    background: #e0e9ff;
}

.preview-info {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.form-group input,
.form-group select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    margin-top: 5px;
    color: #6c757d;
    font-size: 0.85em;
}

.form-actions {
    display: flex;
    align-items: flex-end;
}

.form-actions .btn {
    width: 100%;
}

/* ===================================
   FOOTER
   =================================== */

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    border-top: 1px solid #e0e0e0;
}

footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

/* ===================================
   UTILITIES
   =================================== */

.text-muted {
    color: #6c757d;
    font-style: italic;
}

code {
    background: #f8f9fa;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #e83e8c;
    font-size: 0.9em;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .domain-grid {
        grid-template-columns: 1fr;
    }

    .card {
        margin: 10px;
        padding: 15px;
    }

    .alert {
        margin: 10px;
    }

    .account-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .dns-table {
        font-size: 0.85em;
    }

    .dns-table th,
    .dns-table td {
        padding: 8px 10px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .domain-actions {
        flex-direction: column;
    }
    
    .domain-actions .btn {
        width: 100%;
    }
}

/* ===================================
   ANIMATIONEN
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.card,
.domain-card {
    animation: fadeIn 0.5s ease;
}

/* ===================================
   PRINT STYLES
   =================================== */

/* ===================================
   DOMAIN-LISTE (Kompakte Ansicht)
   =================================== */

.domain-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.domain-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 16px;
    transition: all 0.2s ease;
}

.domain-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.domain-item.active {
    border-color: #28a745;
    background: #f0fff4;
}

.domain-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
}

.domain-name-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.domain-status-icon {
    font-size: 1.2em;
    flex-shrink: 0;
}

.domain-name {
    font-size: 1em;
    color: #333;
    font-weight: 600;
    flex-shrink: 0;
}

.domain-source-badge {
    display: inline-block;
    background: #17a2b8;
    color: white;
    font-size: 0.75em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    flex-shrink: 0;
}

.domain-meta {
    font-size: 0.85em;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.domain-actions-inline {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.domain-actions-inline .btn {
    white-space: nowrap;
}

/* Responsive für kleinere Bildschirme */
@media (max-width: 1200px) {
    .domain-meta {
        font-size: 0.8em;
    }
}

@media (max-width: 900px) {
    .domain-item-header {
        flex-wrap: wrap;
    }
    
    .domain-actions-inline {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ===================================
   PAGINIERUNG
   =================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.pagination-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.pagination-info {
    font-weight: 600;
    color: #333;
    font-size: 1em;
}

@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
    }

    .btn,
    .domain-actions,
    .domain-actions-inline,
    .create-record-form,
    form,
    #domainSearch {
        display: none !important;
    }

    .dns-table {
        border: 1px solid #333;
    }

    .dns-table thead {
        background: #f0f0f0 !important;
        color: #333 !important;
    }
}

/* ===================================
   NEUE BUTTONS FÜR ZONENDATEIEN (v1.2.0)
   =================================== */

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #0f7d6b 0%, #2db86a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f2994e 0%, #f2c94c 100%);
    color: #333;
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d9833b 0%, #d9b239 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(242, 153, 78, 0.4);
}

/* ===================================
   MODAL DIALOG FÜR IMPORT
   =================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.modal-close:hover {
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
}

.modal-body .form-group {
    margin-bottom: 15px;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.modal-body input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px dashed #667eea;
    border-radius: 8px;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-body input[type="file"]:hover {
    background: #f0f1ff;
    border-color: #764ba2;
}

.modal-body small {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 0.85em;
}

