/**
 * Link-Shortener Stylesheet
 * Farben: #C01A54 (Magenta) + #1d3557 (Dunkelblau)
 */

:root {
    --primary: #C01A54;
    --primary-dark: #a01548;
    --primary-light: #d94b7a;
    --secondary: #1d3557;
    --secondary-dark: #152a45;
    --secondary-light: #457b9d;
    --success: #2e7d32;
    --success-bg: #e8f5e9;
    --error: #c62828;
    --error-bg: #ffebee;
    --warning: #f57c00;
    --warning-bg: #fff3e0;
    --text: #333;
    --text-light: #666;
    --text-muted: #999;
    --bg: #f5f7fa;
    --bg-white: #fff;
    --border: #e0e0e0;
    --border-light: #f0f0f0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.2);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: 0.2s ease;
    --nav-width: 240px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

/* Navigation */
.main-nav { position: fixed; left: 0; top: 0; bottom: 0; width: var(--nav-width); background: var(--secondary); color: white; z-index: 1000; overflow-y: auto; }
.nav-container { display: flex; flex-direction: column; height: 100%; }
.nav-logo { display: flex; align-items: center; gap: 12px; padding: 24px 20px; color: white; border-bottom: 1px solid rgba(255,255,255,0.1); }
.logo-icon { font-size: 28px; }
.logo-text { font-size: 18px; font-weight: 700; }
.nav-toggle { display: none; }
.nav-menu { flex: 1; padding: 20px 0; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: rgba(255,255,255,0.8); transition: all var(--transition); border-left: 3px solid transparent; }
.nav-link:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-link.active { background: rgba(255,255,255,0.15); color: white; border-left-color: var(--primary); }
.nav-icon { font-size: 18px; width: 24px; text-align: center; }
.nav-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 15px 20px; }
.nav-user { padding: 20px; border-top: 1px solid rgba(255,255,255,0.1); margin-top: auto; }
.nav-email { display: block; font-size: 13px; color: rgba(255,255,255,0.7); margin-bottom: 8px; word-break: break-all; }
.nav-logout { display: inline-block; font-size: 13px; color: var(--primary-light); padding: 6px 12px; border: 1px solid var(--primary-light); border-radius: var(--radius); transition: all var(--transition); }
.nav-logout:hover { background: var(--primary); border-color: var(--primary); color: white; }

/* Main Content */
.main-content { min-height: 100vh; padding: 30px; }
.main-content.with-nav { margin-left: var(--nav-width); }

/* Flash Messages */
.flash-container { position: fixed; top: 20px; right: 20px; z-index: 9999; max-width: 400px; }
.flash { padding: 16px 20px; border-radius: var(--radius); margin-bottom: 10px; display: flex; align-items: flex-start; gap: 12px; box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.flash-success { background: var(--success-bg); color: var(--success); border: 1px solid #a5d6a7; }
.flash-error { background: var(--error-bg); color: var(--error); border: 1px solid #ef9a9a; }
.flash-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #ffcc80; }
.flash-close { background: none; border: none; font-size: 20px; cursor: pointer; opacity: 0.7; margin-left: auto; }

/* Footer */
.main-footer { margin-left: var(--nav-width); padding: 20px 30px; text-align: center; color: var(--text-muted); font-size: 14px; border-top: 1px solid var(--border); }

/* Page Header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; flex-wrap: wrap; gap: 15px; }
.page-title { font-size: 28px; font-weight: 700; color: var(--secondary); }
.page-subtitle { color: var(--text-light); margin-top: 5px; font-size: 15px; }

/* Cards */
.card { background: var(--bg-white); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 18px; font-weight: 600; color: var(--secondary); }
.card-body { padding: 24px; }
.card-footer { padding: 16px 24px; background: var(--bg); border-top: 1px solid var(--border-light); }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--bg-white); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--primary), var(--secondary)); }
.stat-icon { font-size: 32px; margin-bottom: 12px; }
.stat-value { font-size: 36px; font-weight: 700; color: var(--secondary); line-height: 1; }
.stat-label { font-size: 14px; color: var(--text-muted); margin-top: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border: none; border-radius: var(--radius); font-size: 15px; font-weight: 600; cursor: pointer; transition: all var(--transition); text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: var(--secondary-dark); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-ghost { background: transparent; color: var(--text-light); padding: 8px 16px; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { background: #b71c1c; color: white; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--secondary); font-size: 14px; }
.form-label .required { color: var(--primary); }
.form-input, .form-select, .form-textarea { width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 15px; transition: border-color var(--transition), box-shadow var(--transition); background: var(--bg-white); }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(192, 26, 84, 0.1); }
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.form-error { font-size: 13px; color: var(--error); margin-top: 6px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.form-hp { position: absolute; left: -9999px; opacity: 0; height: 0; }

/* Tables */
.table-wrapper { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border-light); }
.table th { font-weight: 600; color: var(--secondary); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; background: var(--bg); }
.table tr:hover td { background: var(--bg); }
.table-actions { display: flex; gap: 8px; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-secondary { background: var(--bg); color: var(--text-light); }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 30px; }
.pagination a, .pagination span { padding: 10px 16px; border-radius: var(--radius); font-weight: 500; }
.pagination a { background: var(--bg-white); color: var(--text); border: 1px solid var(--border); }
.pagination a:hover { background: var(--primary); color: white; border-color: var(--primary); }
.pagination .active { background: var(--primary); color: white; }
.pagination .disabled { opacity: 0.5; cursor: not-allowed; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 64px; margin-bottom: 20px; opacity: 0.5; }
.empty-title { font-size: 20px; color: var(--secondary); margin-bottom: 10px; }
.empty-text { color: var(--text-muted); margin-bottom: 20px; }

/* Auth Pages */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%); padding: 20px; }
.auth-card { background: var(--bg-white); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); width: 100%; max-width: 420px; overflow: hidden; }
.auth-header { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; padding: 40px 30px; text-align: center; }
.auth-logo { font-size: 48px; margin-bottom: 15px; }
.auth-title { font-size: 24px; font-weight: 700; }
.auth-subtitle { opacity: 0.9; margin-top: 5px; font-size: 14px; }
.auth-body { padding: 40px 30px; }
.auth-footer { padding: 20px 30px; background: var(--bg); text-align: center; font-size: 14px; color: var(--text-muted); border-top: 1px solid var(--border-light); }

/* Link Cards */
.link-card { background: var(--bg-white); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 15px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 20px; transition: box-shadow var(--transition); }
.link-card:hover { box-shadow: var(--shadow-lg); }
.link-info { flex: 1; min-width: 0; }
.link-short { font-size: 18px; font-weight: 600; color: var(--primary); word-break: break-all; }
.link-target { font-size: 14px; color: var(--text-muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-meta { display: flex; gap: 15px; margin-top: 10px; font-size: 13px; color: var(--text-light); }
.link-clicks { display: flex; align-items: center; gap: 6px; font-size: 24px; font-weight: 700; color: var(--secondary); }
.link-clicks span { font-size: 13px; font-weight: normal; color: var(--text-muted); }

/* Copy Button */
.copy-btn { background: var(--bg); border: 1px solid var(--border); padding: 8px 16px; border-radius: var(--radius); cursor: pointer; font-size: 13px; transition: all var(--transition); display: inline-flex; align-items: center; gap: 6px; }
.copy-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.copy-btn.copied { background: var(--success); color: white; border-color: var(--success); }

/* Search Box */
.search-box { display: flex; gap: 10px; max-width: 400px; }
.search-box .form-input { flex: 1; }

/* AI Link Generator */
.ai-generator { background: linear-gradient(135deg, var(--secondary), var(--secondary-light)); border-radius: var(--radius-xl); padding: 30px; color: white; margin-bottom: 30px; }
.ai-generator .form-label { color: white; }
.ai-generator .form-input, .ai-generator .form-select { background: rgba(255,255,255,0.95); }
.platform-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.platform-option { position: relative; }
.platform-option input { position: absolute; opacity: 0; }
.platform-option label { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: rgba(255,255,255,0.1); border-radius: var(--radius); cursor: pointer; transition: all var(--transition); border: 2px solid transparent; }
.platform-option input:checked + label { background: rgba(255,255,255,0.2); border-color: var(--primary-light); }
.platform-option label:hover { background: rgba(255,255,255,0.15); }
.platform-icon { font-size: 24px; }
.ai-result { background: var(--bg-white); border-radius: var(--radius); padding: 20px; margin-top: 20px; color: var(--text); }
.ai-result-url { background: var(--bg); padding: 12px 16px; border-radius: var(--radius); font-family: monospace; font-size: 14px; word-break: break-all; margin-bottom: 15px; }

/* Responsive */
@media (max-width: 768px) {
    .main-nav { position: fixed; left: -100%; width: 100%; max-width: 280px; transition: left 0.3s; z-index: 1001; }
    .main-nav.open { left: 0; }
    .nav-toggle { display: flex; flex-direction: column; gap: 5px; background: var(--secondary); border: none; cursor: pointer; padding: 10px; position: fixed; top: 10px; left: 10px; z-index: 1002; border-radius: var(--radius); }
    .nav-toggle span { width: 24px; height: 2px; background: white; }
    .main-content.with-nav { margin-left: 0; padding-top: 70px; }
    .main-footer { margin-left: 0; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .link-card { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
