:root {
    --primary: #012c6d;
    --accent: #ff9800;
    --bg: #f0f2f5;
    --white: #ffffff;
    --danger: #ff4d4d;
    --text: #2d3436;
    --gray: #b2bec3;
}


* { box-sizing: border-box; } /* CRITICAL FIX: Isse input bahar nahi jayega */

body { background-color: var(--bg); color: var(--text); padding: 15px; font-family: 'Segoe UI', sans-serif; margin: 0; }

.container { max-width: 480px; margin: 0 auto; padding-bottom: 50px; }

/* Cards */
.card { background: var(--white); padding: 15px; border-radius: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin-bottom: 20px; position: relative; }

/* Headings & Text */
h2 { color: var(--primary); margin-top: 0; margin-bottom: 20px; font-weight: 700; }
h3 { margin: 0 0 5px 0; font-size: 1.2rem; }
.small-text { font-size: 0.9rem; color: #666; margin-bottom: 15px; display: block; }

/* Inputs - Fixed Overflow */
input, textarea, select { 
    width: 100%; 
    padding: 12px 15px; 
    margin-bottom: 15px; 
    border: 1px solid #ddd; 
    border-radius: 10px; 
    font-size: 16px; 
    outline: none;
    transition: border 0.3s;
    background: #f9f9f9;
}
input:focus, textarea:focus { border-color: var(--primary); background: #fff; }

/* Buttons */
.btn { display: block; width: 100%; padding: 14px; background: var(--primary); color: white; border: none; border-radius: 12px; font-size: 1rem; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer; transition: 0.2s; }
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-secondary { background: #e3f2fd; color: var(--primary); }
.btn-download { background: var(--accent); color: #000; }

/* Action Button Group (Side by Side) */
.action-group { display: flex; gap: 10px; margin-top: 15px; }
.action-group .btn { margin-bottom: 0; font-size: 0.9rem; padding: 12px; display: flex; align-items: center; justify-content: center; }

/* Delete Icon Button (Top Right) */
.delete-btn-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    z-index: 10;
    transition: color 0.3s;
}
.delete-btn-icon:hover { color: var(--danger); }

/* Back Link Centered */
.back-link {
    display: block;
    text-align: center;
    color: #999;
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 10px;
}
.back-link:hover { color: var(--primary); }

/* Hero Book specific */
.hero-book { border: 2px solid var(--primary); background: #eef4ff; }
.hero-book::before { content: 'Currently Reading'; position: absolute; top: -12px; left: 20px; background: var(--primary); color: white; font-size: 0.75rem; padding: 4px 12px; border-radius: 20px; font-weight: bold; }
.reading-status { font-size: 1.1rem; color: var(--primary); font-weight: 500; margin-bottom: 10px; line-height: 1.5; margin-top: 10px;}

/* Progress Bar */
.progress-track { background: #e0e0e0; height: 8px; border-radius: 4px; overflow: hidden; margin: 10px 0; }
.progress-fill { background: var(--primary); height: 100%; }
.flex-row { display: flex; justify-content: space-between; font-size: 0.85rem; color: #666; }

/* Branding Header */
.app-header {
    text-align: center;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 2px solid #eee;
}
.brand-img {
    width: 250px; /* Size adjust karein */
    height: 40px;
    object-fit: contain;
}
.brand-sub { font-size: 0.8rem; color: #888; letter-spacing: 2px; }


/* Admin Tables */
.admin-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.9rem; }
.admin-table th { background: #e3f2fd; color: var(--primary); padding: 10px; text-align: left; }
.admin-table td { border-bottom: 1px solid #eee; padding: 10px; color: #555; }
.admin-table tr:hover { background: #f9f9f9; }

/* Last Note in Library */
.last-note {
    background: #fff8e1; /* Light Yellow */
    color: #5d4037;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-top: 8px;
    font-style: italic;
    border-left: 3px solid #ffb300;
}



body {
    background-color: var(--bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 480px; /* Mobile width lock */
    background: var(--bg);
    padding: 20px;
    box-sizing: border-box;
}

/* Header Section */
.dashboard-header {
    background: var(--white);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    text-align: center;
}

.dashboard-header h2 {
    color: var(--primary);
    margin: 0 0 5px 0;
    font-size: 1.5rem;
}

.stats-badge {
    background: #e3f2fd;
    color: var(--primary);
    padding: 10px 15px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 10px;
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 columns */
    gap: 15px;
    margin-bottom: 20px;
}

.action-card {
    background: var(--white);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    text-decoration: none;
    color: var(--primary);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: #eef2f6;
}

.action-card.primary {
    background: var(--primary);
    color: var(--white);
}

.card-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.card-title {
    font-weight: 600;
    font-size: 1rem;
}

/* Admin Button (Full Width) */
.admin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: #2d3436;
    color: white;
    padding: 15px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Footer Links */
.footer-link {
    display: block;
    text-align: center;
    color: var(--gray);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 10px;
}
.footer-link:hover { color: var(--primary); }


/* Timeline for Notes (view_notes.php) */
.timeline {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid #e0e0e0;
    margin-top: 10px;
}
.timeline-item {
    position: relative;
    margin-bottom: 25px;
}
.timeline-marker {
    position: absolute;
    left: -26px; /* Adjust to sit on line */
    top: 0;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid #fff;
}
.timeline-content {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
}
.page-tag {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 5px;
}
.date-tag {
    font-size: 0.75rem;
    color: #999;
}
.note-text {
    margin-top: 8px;
    font-style: italic;
    color: #444;
    line-height: 1.5;
}

.delete-btn-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #ff0000; /* Red color for delete */
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s, color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn-icon:hover {
    background: #fff0f0;
    color: #cc0000;
}

.delete-btn-icon svg {
    display: block;
}

.btn-download-small {
    background: #e3f2fd;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
}
.btn-download-small:hover { background: #bbdefb; }

.note-actions svg {
    vertical-align: middle;
    opacity: 0.7;
    transition: 0.3s;
}
.note-actions a:hover svg, .note-actions button:hover svg {
    opacity: 1;
    transform: scale(1.1);
}

.success-banner {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 12px 20px;
    border-radius: 8px;
    border-left: 5px solid #4caf50;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}