/* ===========================================
   DASHBOARD STYLES
   =========================================== */

/* Dark background for dashboard */
body {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
    min-height: 100vh;
}

/* Override landing.css navbar for dark theme */
.navbar .logo {
    color: white;
}

.navbar .nav-links a {
    color: rgba(255, 255, 255, 0.7);
}

.navbar .nav-links a:hover,
.navbar .nav-links a.active {
    color: white;
}

.navbar.scrolled {
    background: rgba(15, 23, 42, 0.95);
}

/* Dashboard Header */
.dashboard-header {
    padding: 6rem 2rem 3rem;
    text-align: center;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.dashboard-header .header-content {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
}

.btn-create {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #FF6B6B 0%, #9B59B6 50%, #3498DB 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-create svg {
    width: 20px;
    height: 20px;
}

/* Dashboard Main */
.dashboard-main {
    padding: 2rem;
    min-height: 50vh;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    color: rgba(255, 255, 255, 0.4);
}

.empty-icon svg {
    width: 100%;
    height: 100%;
}

.empty-state h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2rem;
}

.empty-state .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #FF6B6B 0%, #9B59B6 50%, #3498DB 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.empty-state .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.empty-state .btn-primary svg {
    width: 18px;
    height: 18px;
}

/* Newsletter Cards Grid */
.newsletters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.newsletters-grid.hidden {
    display: none;
}

/* Newsletter Card */
.newsletter-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.newsletter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.card-preview {
    height: 160px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card-preview::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(155, 89, 182, 0.1) 50%, rgba(52, 152, 219, 0.1) 100%);
}

.card-preview .preview-icon {
    width: 48px;
    height: 48px;
    color: rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

/* Mini preview of newsletter content */
.card-preview .mini-preview {
    width: 80%;
    height: 80%;
    background: white;
    border-radius: 4px;
    padding: 8px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.mini-preview .mini-header {
    height: 20%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    margin-bottom: 6px;
}

.mini-preview .mini-line {
    height: 6px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-bottom: 4px;
}

.mini-preview .mini-line.short {
    width: 60%;
}

.mini-preview .mini-line.medium {
    width: 80%;
}

.card-content {
    padding: 1.25rem;
}

.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1rem;
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-meta svg {
    width: 14px;
    height: 14px;
}

.card-actions {
    display: flex;
    gap: 0.75rem;
}

.card-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.card-btn.primary {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: white;
}

.card-btn.primary:hover {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
}

.card-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.card-btn.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.card-btn.danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

.card-btn svg {
    width: 16px;
    height: 16px;
}

/* Dashboard Footer */
.dashboard-footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
}

.dashboard-footer p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

.dashboard-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: underline;
}

.dashboard-footer a:hover {
    color: white;
}

/* Confirm Delete Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

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

.modal {
    background: #1a1a2e;
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.75rem;
}

.modal p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-actions button {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.modal-actions .btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-actions .btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

.modal-actions .btn-delete {
    background: #ef4444;
    color: white;
}

.modal-actions .btn-delete:hover {
    background: #dc2626;
}

/* Active nav link */
.nav-links a.active {
    color: white;
    font-weight: 600;
}

/* Auth Area */
.auth-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-login,
.btn-signup {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-login {
    color: rgba(255, 255, 255, 0.8);
}

.btn-login:hover {
    color: white;
}

.btn-signup {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: white;
}

.btn-signup:hover {
    transform: translateY(-1px);
}

.user-greeting {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Card Badges */
.card-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    min-height: 22px;
}

.badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-published {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge-public {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 5rem 1rem 2rem;
    }

    .dashboard-header h1 {
        font-size: 2rem;
    }

    .newsletters-grid {
        grid-template-columns: 1fr;
    }

    .card-actions {
        flex-direction: column;
    }
}
