/* ========================================
   STYLE.CSS - COLORFUL MOBILE-FIRST BLOG
   Modern gradient theme with glassmorphism
   ======================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&family=Poppins:wght@400;500;600;700&display=swap');

/* ===== RESET & VARIABLES ===== */
:root {
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-5: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-header: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    
    --bg-primary: #f8f9ff;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --white: #ffffff;
    --shadow-sm: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.15);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.2);
    --border-radius-sm: 15px;
    --border-radius-md: 25px;
    --border-radius-lg: 35px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    opacity: 0;
    animation: fadeIn 0.8s ease-in forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== CONTAINER ===== */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px 80px 16px;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
    background: var(--gradient-header);
    padding: 40px 20px 30px 20px;
    border-radius: 0 0 40px 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.2) 0%, transparent 50%);
    pointer-events: none;
}

.blog-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
    font-family: 'Poppins', sans-serif;
    position: relative;
    z-index: 1;
}

.blog-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

/* ===== POST CARDS ===== */
.posts-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-card {
    background: var(--white);
    border-radius: var(--border-radius-md);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    animation: cardPop 0.5s ease-out;
}

@keyframes cardPop {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.post-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-md);
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--gradient-2);
}

.post-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.3;
    font-family: 'Poppins', sans-serif;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.post-preview {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
}

.post-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--gradient-4);
    padding: 5px 12px;
    border-radius: 50px;
    color: white;
    font-weight: 600;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    background: var(--gradient-2);
    color: white;
    box-shadow: 0 4px 15px rgba(240, 98, 146, 0.4);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(240, 98, 146, 0.5);
}

.btn-secondary {
    background: var(--gradient-1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-back {
    background: var(--gradient-3);
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
}

.read-more {
    background: var(--gradient-3);
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.read-more:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.5);
}

/* ===== FORM STYLES ===== */
.form-container {
    background: white;
    border-radius: var(--border-radius-md);
    padding: 30px 20px;
    box-shadow: var(--shadow-md);
    margin: 20px 0;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

textarea.form-input {
    min-height: 200px;
    resize: vertical;
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 12px 20px 25px 20px;
    box-shadow: 0 -5px 30px rgba(0,0,0,0.1);
    border-radius: 30px 30px 0 0;
    z-index: 1000;
    max-width: 480px;
    margin: 0 auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    transition: all 0.3s ease;
    gap: 4px;
}

.nav-item i {
    font-size: 1.5rem;
    background: var(--gradient-5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-item.active {
    color: #667eea;
    transform: translateY(-5px);
}

.nav-item.active i {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== POST PAGE ===== */
.post-page {
    background: white;
    border-radius: var(--border-radius-md);
    padding: 30px 20px;
    box-shadow: var(--shadow-sm);
}

.post-page-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: var(--gradient-header);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.3;
}

.post-page-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin: 30px 0;
}

/* ===== DARK MODE TOGGLE ===== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 1001;
    border: none;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(180deg);
}

/* ===== DARK MODE STYLES ===== */
body.dark-mode {
    --bg-primary: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --white: #16213e;
}

body.dark-mode .post-card {
    background: #1f1f3a;
    border-color: #2a2a4a;
}

body.dark-mode .form-container {
    background: #1f1f3a;
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    background: white;
    border-radius: var(--border-radius-md);
    margin: 20px 0;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.mt-4 { margin-top: 20px; }
.mb-4 { margin-bottom: 20px; }
.hidden { display: none; }

/* ===== RESPONSIVE FINE-TUNING ===== */
@media (max-width: 380px) {
    .container { padding: 15px 12px 80px 12px; }
    .blog-title { font-size: 2.2rem; }
    .post-title { font-size: 1.4rem; }
    .btn { padding: 10px 20px; }
}