/* Scriptoria Home Page Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: #ffffff;
    min-height: 100vh;
    position: relative;
}

.header {
    position: fixed;
    top: 0;
    right: 0;
    padding: 30px 40px;
    z-index: 100;
}

.auth-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.auth-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 25px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.auth-btn.primary {
    background: linear-gradient(135deg, #fe7f2d 0%, #ff6b35 100%);
    border-color: transparent;
}

.auth-btn.primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6b4190 100%);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px 40px;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    flex-direction: column;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #fe7f2d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.name {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fe7f2d 0%, #ff6b35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.username {
    font-size: 18px;
    color: #b0b0b0;
    margin-bottom: 15px;
}

.bio {
    font-size: 16px;
    color: #e0e0e0;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.stats {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.stat {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #fe7f2d;
    display: block;
}

.stat-label {
    font-size: 14px;
    color: #b0b0b0;
    margin-top: 5px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 25px 0;
    color: #ffffff;
    text-align: center;
}

/* Search highlighting styles */
.search-highlight {
    background: #fe7f2d;
    color: #ffffff;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Header with auth buttons */
.header-nav {
    position: fixed;
    top: 0;
    right: 0;
    padding: 30px 40px;
    z-index: 100;
    display: flex;
    gap: 15px;
    align-items: center;
}

.auth-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 25px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    color: #fe7f2d;
}

.auth-btn.primary {
    background: linear-gradient(135deg, #fe7f2d 0%, #ff6b35 100%);
    border-color: transparent;
    color: #ffffff;
}

.auth-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(254, 127, 45, 0.4);
    color: #ffffff;
}

/* Simple header styles */
.simple-header {
    text-align: center;
    padding: 65px 20px 20px;
}

.simple-header h1 {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fe7f2d 0%, #ff6b35 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

.simple-header p {
    font-size: 1.2rem;
    color: #b0b0b0;
    max-width: 600px;
    margin: 0 auto 30px;
}

/* Search box positioning */
.header-search {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
}

.header-search .search-input {
    width: 100%;
    max-width: 500px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    color: #ffffff;
    font-size: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.header-search .search-input::placeholder {
    color: #888;
}

.header-search .search-input:focus {
    outline: none;
    border-color: #fe7f2d;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(254, 127, 45, 0.3);
}

/* User menu for authenticated users */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fe7f2d 0%, #ff6b35 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* === PROFILE CARD STYLES === */
.profile-card {
    position: relative;
    overflow: hidden;
    background: #1a1d21;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 1200px;
    margin: 0 auto 2rem;
    width: 100%;
}

/* Glowing Orb 1 */
.profile-card::before {
    content: '';
    position: absolute;
    top: -150px;
    left: -150px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.4), transparent 60%);
    filter: blur(100px);
    animation: moveBlob1 20s infinite alternate ease-in-out;
    z-index: 1;
}

/* Glowing Orb 2 */
.profile-card::after {
    content: '';
    position: absolute;
    bottom: -200px;
    right: -200px;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.4), transparent 60%);
    filter: blur(120px);
    animation: moveBlob2 25s infinite alternate ease-in-out;
    z-index: 1;
}

/* Keyframes for the orb animations */
@keyframes moveBlob1 {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    100% { transform: translate(100px, 80px) rotate(180deg) scale(1.1); }
}

@keyframes moveBlob2 {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    100% { transform: translate(-120px, -50px) rotate(270deg) scale(1.2); }
}

/* === CMS BADGE === */
.cms-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 3;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cms-badge svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Ensure profile content is on top of the animation */
.profile-content {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.profile-left {
    flex-shrink: 0;
}

.profile-right {
    flex: 1;
    min-width: 0;
}

/* === LOGO STYLES === */
.logo-large {
    width: 250px;
    height: 250px;
    border-radius: 20px;
    border: 4px solid #fe7f2d;
    box-shadow: 0 8px 24px rgba(254, 127, 45, 0.3);
    transition: transform 0.3s ease;
    object-fit: cover;
    background: linear-gradient(135deg, #fe7f2d 0%, #ff6b35 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.logo-large:hover {
    transform: scale(1.05);
}

.profile-card .name {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.profile-card .username {
    font-size: 1.2rem;
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.profile-card .bio {
    font-size: 1.1rem;
    color: #e5e7eb;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.profile-card .stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.profile-card .stat {
    text-align: center;
    min-width: 60px;
    background: rgba(0,0,0,0.2);
}

.profile-card .stat-number {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fe7f2d;
    margin-bottom: 0.3rem;
}

.profile-card .stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
}

/* Article Styles */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.article-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.5s ease;
}

.article-card:hover::before {
    left: 100%;
}

.article-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.article-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.article-author {
    font-size: 13px;
    color: #fe7f2d;
    font-style: italic;
    margin: 5px 0 10px 0;
    font-weight: 500;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.status-published {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
}

.status-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
}

.status-draft {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #ffffff;
}

.status-rejected {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
}

.article-excerpt {
    color: #b0b0b0;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.article-date, .read-time {
    font-size: 12px;
    color: #888888;
}

.article-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.read-more-btn {
    background: linear-gradient(135deg, #fe7f2d 0%, #ff6b35 100%);
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(254, 127, 45, 0.4);
}

.error-message {
    text-align: center;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 15px;
    padding: 30px;
    margin: 40px 0;
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .container { padding: 100px 25px 25px; }
    .stats { gap: 15px; }
    .articles-grid { grid-template-columns: 1fr; }
    
    .search-box {
        top: 15px;
        right: 25px;
    }
    
    .search-input {
        width: 250px;
        padding: 6px 12px;
        font-size: 11px;
    }

    /* Mobile responsive styles for header navigation */
    .header-nav {
        padding: 20px 25px;
        gap: 10px;
    }
    
    .auth-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .simple-header {
        padding: 80px 20px 30px;
    }
    
    .simple-header h1 {
        font-size: 3rem;
    }
    
    .header-search .search-input {
        max-width: 90%;
        padding: 14px 20px;
    }

    /* Profile responsive styles */
    .profile-card {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .cms-badge {
        top: 15px;
        right: 15px;
        font-size: 10px;
        padding: 4px 8px;
        gap: 4px;
    }
    
    .cms-badge svg {
        width: 12px;
        height: 12px;
    }

    .profile-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .logo-large {
        width: 180px;
        height: 180px;
        margin: 0 auto;
        font-size: 28px;
    }

    .profile-card .name {
        font-size: 2rem;
    }

    .profile-card .stats {
        justify-content: center;
        gap: 1rem;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .header {
        padding: 20px 25px;
    }

    .auth-links {
        gap: 10px;
    }

    .auth-btn {
        padding: 8px 20px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .search-input {
        width: 200px;
    }
}
