/**
 * Aegerter Portal - Stylesheet
 * ============================
 * Modernes, sicheres Design
 */

:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #0d1b2a;
    --accent: #3182ce;
    --success: #38a169;
    --warning: #d69e2e;
    --danger: #e53e3e;
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --transition: all 0.2s ease;
}

* {
    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, var(--primary-dark) 0%, var(--primary) 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

/* Login-Seite mit Hintergrundbild */
body.login-page {
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.7) 0%, rgba(13, 27, 42, 0.8) 100%),
                url('../../uploads/login-bg.jpg') center/cover no-repeat fixed;
}

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

/* Login Container */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}

.login-box h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.75rem;
}

.login-box .subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 30px;
    font-size: 0.9rem;
}

/* Logo */
.logo {
    text-align: center;
    margin-bottom: 20px;
}

.logo svg {
    width: 60px;
    height: 60px;
    fill: var(--primary);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #2f855a;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-danger {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.alert-success {
    background: #c6f6d5;
    color: #276749;
    border: 1px solid #9ae6b4;
}

.alert-warning {
    background: #fefcbf;
    color: #975a16;
    border: 1px solid #faf089;
}

.alert-info {
    background: #bee3f8;
    color: #2b6cb0;
    border: 1px solid #90cdf4;
}

/* Header */
.header {
    background: white;
    padding: 15px 30px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 1.25rem;
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.session-timer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.session-timer.warning {
    background: #fefcbf;
    color: #975a16;
}

.session-timer.danger {
    background: #fed7d7;
    color: #c53030;
}

/* Dashboard Grid */
.dashboard {
    padding: 30px;
}

.websites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

/* Website Card */
.website-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.website-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.website-card-image {
    height: 160px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.website-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.website-card-image .placeholder {
    color: var(--gray-400);
    font-size: 3rem;
}

.website-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.website-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.website-card-url {
    font-size: 0.8rem;
    color: var(--gray-500);
    word-break: break-all;
    margin-bottom: 10px;
}

.website-card-description {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 16px;
    flex-grow: 1;
}

.website-card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.website-card-actions .btn {
    flex: 1;
}

/* Add Card */
.add-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: white;
}

.add-card:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.add-card .icon {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.7;
}

.add-card span {
    font-size: 1rem;
    opacity: 0.9;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-700);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Image Preview */
.image-preview {
    width: 100%;
    height: 150px;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    overflow: hidden;
}

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

.image-preview .placeholder {
    color: var(--gray-400);
}

/* QR Code Box */
.qr-box {
    text-align: center;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin: 20px 0;
}

.qr-box img {
    margin-bottom: 15px;
}

.secret-key {
    font-family: 'Courier New', monospace;
    background: var(--gray-200);
    padding: 10px 15px;
    border-radius: var(--radius);
    letter-spacing: 2px;
    font-size: 1.1rem;
    word-break: break-all;
}

/* Setup Steps */
.setup-steps {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.step {
    display: flex;
    align-items: center;
    color: var(--gray-400);
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 8px;
}

.step.active .step-number {
    background: var(--primary);
    color: white;
}

.step.active {
    color: var(--primary);
}

.step.completed .step-number {
    background: var(--success);
    color: white;
}

.step-divider {
    width: 40px;
    height: 2px;
    background: var(--gray-200);
    margin: 0 10px;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .login-box {
        padding: 30px 20px;
    }
    
    .websites-grid {
        grid-template-columns: 1fr;
    }
    
    .modal {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Confirmation Dialog */
.confirm-dialog {
    text-align: center;
    padding: 20px;
}

.confirm-dialog p {
    margin-bottom: 20px;
    color: var(--gray-600);
}

.confirm-dialog .btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}
