/* style.css - Premium Modern UI/UX Design System for Blogify */

:root {
    --bg-base: #fff5eb; /* Warm peach/orange white background */
    --bg-surface: #ffffff;
    --text-primary: #2d1b00; /* Dark warm brown text */
    --text-secondary: #5c4221; /* Medium warm brown text */
    --text-muted: #a08c70; /* Muted warm brown text */
    
    /* Vibrant Orange & Amber Brand Gradient */
    --brand-start: #f57c00; /* Deep Orange */
    --brand-end: #ff9800; /* Amber */
    --brand-accent: #e86f00; /* Heritage Accent */
    --brand-accent-hover: #d84315;
    
    --border-color: #ffd1a6; /* Warm orange border */
    --border-focus: #f57c00; /* Border on focus */
    
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --shadow-sm: 0 1px 3px 0 rgba(245, 124, 0, 0.05), 0 1px 2px -1px rgba(245, 124, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(245, 124, 0, 0.05), 0 2px 4px -2px rgba(245, 124, 0, 0.05), 0 10px 15px -3px rgba(245, 124, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(245, 124, 0, 0.05), 0 8px 10px -6px rgba(245, 124, 0, 0.05);
    
    --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 20px;
}

/* Glassmorphism Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
}

.nav-left {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.nav-links a:hover {
    color: var(--text-primary);
    background-color: rgba(99, 102, 241, 0.05);
    text-decoration: none;
}

.nav-user {
    font-weight: 700;
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.08);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

h2 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.75px;
    margin-top: 12px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Premium Card Design */
.card {
    background-color: var(--bg-surface);
    padding: 24px;
    margin: 20px 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-focus);
}

.auth-card {
    max-width: 480px;
    margin: 40px auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.muted {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

/* Grid Layouts */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 16px 0 24px;
}

.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Profile Redesign */
.profile-header {
    display: flex;
    gap: 24px;
    align-items: center;
    background-color: var(--bg-surface);
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.profile-info {
    display: flex;
    gap: 20px;
    align-items: center;
    width: 100%;
}

.profile-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px var(--brand-start);
}

.profile-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
}

.profile-meta h3 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.profile-meta p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.profile-bio {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--brand-start);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.author-list {
    list-style: none;
    padding: 0;
    margin-top: 16px;
}

.author-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.author-list li:last-child {
    border-bottom: none;
}

.author-list li a {
    color: #ef4444;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
}

.author-list li a:hover {
    text-decoration: underline;
}

/* Collapsible Forms */
.collapsible {
    margin-top: 20px;
}

.collapsible summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--brand-start);
    margin-bottom: 12px;
    outline: none;
    transition: var(--transition-smooth);
}

.collapsible summary:hover {
    color: var(--brand-end);
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.posting-as {
    padding: 10px 14px;
    background-color: var(--bg-base);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    text-align: left;
}

.btn-full {
    width: 100%;
    margin-top: 10px;
}

.form-actions-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.btn-outline {
    background: transparent !important;
    border: 1px solid var(--border-color) !important;
    color: var(--brand-start) !important;
    box-shadow: none !important;
}

.btn-outline:hover {
    background: var(--bg-base) !important;
    border-color: var(--brand-start) !important;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.auth-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

input, textarea, select {
    width: 100%;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-smooth);
}

input:focus, textarea:focus, select:focus {
    border-color: var(--brand-start);
    box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.15);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Interactive Buttons */
button, .btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    border: none;
    background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
    color: #ffffff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(245, 124, 0, 0.15);
    transition: var(--transition-smooth);
}

button:hover, .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 124, 0, 0.3);
    text-decoration: none;
    color: #ffffff;
}

button:active, .btn:active {
    transform: translateY(0);
}

a.btn {
    background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-add-author {
    margin-top: 8px;
    background: linear-gradient(135deg, var(--brand-accent), #f97316);
}

/* Links & Accents */
a {
    color: var(--brand-start);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
}

a:hover {
    color: var(--brand-end);
    text-decoration: underline;
}

/* Action Links in lists */
.admin-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.admin-actions a {
    font-size: 0.85rem;
    font-weight: 700;
}

.admin-actions a:last-child {
    color: #ef4444;
}

.admin-actions a:last-child:hover {
    color: #dc2626;
}

/* Search Form */
.search-form {
    margin: 16px 0 28px;
    display: flex;
    gap: 12px;
    max-width: 500px;
}

.search-form select {
    max-width: 220px;
}

.search-form button {
    flex-shrink: 0;
}

/* Post Grid Redesign */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.post-grid .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.post-grid .card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.3;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.post-grid .card small {
    display: block;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.post-grid .card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

/* Manage Posts Panel */
.manage-posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.manage-post-card {
    padding: 20px;
}

.manage-post-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.clamp-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.manage-post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

/* Pagination */
.pagination {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.pagination a {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.pagination a:hover {
    border-color: var(--brand-start);
    color: var(--brand-start);
    background-color: rgba(99, 102, 241, 0.03);
}

.pagination span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 20px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .nav-links a {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}
