/*
Theme Name: D Genius Learning Hub for Pharmacy Technicians
Theme URI: https://dgeniuspharmacy.com
Author: D Genius Team
Author URI: https://dgeniuspharmacy.com
Description: A comprehensive WordPress theme for Pharmacy Technician learning hub with quiz system, certificate generation, and course management.
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: d-genius-pharmacy
Domain Path: /languages
Tags: education, pharmacy, learning, quiz, certificate, responsive
*/

/* ================================
   ROOT VARIABLES
================================ */
:root {
    --primary-color: #1e88e5;
    --primary-dark: #1565c0;
    --primary-light: #64b5f6;
    --secondary-color: #00897b;
    --secondary-dark: #00695c;
    --accent-color: #ffd700;
    --text-dark: #2c3e50;
    --text-light: #546e7a;
    --text-muted: #90a4ae;
    --bg-light: #f5f7fa;
    --bg-white: #ffffff;
    --border-color: #e0e6ed;
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

/* ================================
   RESET & BASE
================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ================================
   TYPOGRAPHY
================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

/* ================================
   LAYOUT
================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

/* ================================
   HEADER
================================ */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo img {
    height: 50px;
    width: auto;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.site-description {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0;
}

/* ================================
   NAVIGATION
================================ */
.main-navigation {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: white;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: var(--transition);
}

.nav-menu a:hover::after {
    width: 100%;
}

/* ================================
   BUTTONS
================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary-color) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
}

/* ================================
   CARDS
================================ */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

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

.card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

/* ================================
   FORMS
================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    background: var(--bg-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ================================
   AUTHENTICATION PAGES
================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.auth-header img {
    height: 80px;
    margin-bottom: 1rem;
}

.auth-body {
    padding: 2rem;
}

.auth-footer {
    text-align: center;
    padding: 1rem 2rem 2rem;
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 500;
}

/* ================================
   DASHBOARD
================================ */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--text-dark);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    text-align: center;
}

.sidebar-header img {
    height: 60px;
    margin-bottom: 0.5rem;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu li {
    margin: 0.25rem 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.5rem;
    color: rgba(255,255,255,0.8);
    transition: var(--transition);
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left: 4px solid var(--accent-color);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    background: var(--bg-light);
    min-height: 100vh;
}

/* ================================
   STATS CARDS
================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue {
    background: rgba(30, 136, 229, 0.1);
    color: var(--primary-color);
}

.stat-icon.green {
    background: rgba(0, 137, 123, 0.1);
    color: var(--secondary-color);
}

.stat-icon.gold {
    background: rgba(255, 215, 0, 0.1);
    color: #b8860b;
}

.stat-content h3 {
    font-size: 2rem;
    margin: 0;
    color: var(--text-dark);
}

.stat-content p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ================================
   COURSE CHAPTERS
================================ */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.chapter-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.chapter-header {
    padding: 1rem 1.5rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chapter-number {
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.chapter-body {
    padding: 1.5rem;
}

.chapter-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.chapter-status.completed {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
}

.chapter-status.in-progress {
    background: rgba(255, 152, 0, 0.1);
    color: var(--warning-color);
}

.chapter-status.locked {
    background: rgba(144, 164, 174, 0.1);
    color: var(--text-muted);
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ================================
   QUIZ STYLES
================================ */
.quiz-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.quiz-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-light);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--text-dark);
}

.quiz-timer.warning {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.question-card {
    margin-bottom: 2rem;
}

.question-number {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.question-text {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.options-list {
    list-style: none;
}

.option-item {
    margin-bottom: 0.75rem;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.option-label:hover {
    border-color: var(--primary-light);
    background: rgba(30, 136, 229, 0.05);
}

.option-label input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

.option-label.selected {
    border-color: var(--primary-color);
    background: rgba(30, 136, 229, 0.1);
}

.option-label.correct {
    border-color: var(--success-color);
    background: rgba(76, 175, 80, 0.1);
}

.option-label.incorrect {
    border-color: var(--error-color);
    background: rgba(244, 67, 54, 0.1);
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

/* ================================
   CERTIFICATE
================================ */
.certificate-preview {
    background: white;
    border: 20px solid #1e88e5;
    padding: 60px;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.certificate-preview::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid #00897b;
    pointer-events: none;
}

.certificate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.certificate-logo {
    height: 80px;
}

.certificate-title {
    font-size: 3rem;
    color: #1e88e5;
    margin: 1rem 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.certificate-subtitle {
    font-size: 1.2rem;
    color: #00897b;
    margin-bottom: 2rem;
}

.certificate-recipient {
    font-size: 2.5rem;
    color: #2c3e50;
    font-family: 'Georgia', serif;
    font-style: italic;
    margin: 2rem 0;
    padding: 1rem;
    border-bottom: 2px solid #1e88e5;
    display: inline-block;
}

.certificate-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #546e7a;
    margin: 2rem 0;
}

.certificate-topics {
    text-align: left;
    max-width: 600px;
    margin: 2rem auto;
}

.certificate-topics ul {
    list-style: none;
    padding: 0;
}

.certificate-topics li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.certificate-topics li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #00897b;
    font-weight: bold;
}

.certificate-footer {
    display: flex;
    justify-content: space-around;
    margin-top: 3rem;
    padding-top: 2rem;
}

.signature-line {
    text-align: center;
}

.signature-line .line {
    width: 150px;
    height: 2px;
    background: #2c3e50;
    margin: 0 auto 0.5rem;
}

.signature-line .name {
    font-weight: 600;
    color: #2c3e50;
}

.signature-line .title {
    font-size: 0.85rem;
    color: #90a4ae;
}

/* ================================
   NEWS SECTION
================================ */
.news-ticker {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 0.75rem 0;
    overflow: hidden;
}

.news-ticker-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

.news-label {
    background: var(--accent-color);
    color: var(--text-dark);
    padding: 0.25rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

.news-scroll {
    flex: 1;
    overflow: hidden;
}

.news-scroll-content {
    display: flex;
    gap: 40px;
    animation: scroll 30s linear infinite;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.news-item {
    white-space: nowrap;
}

/* ================================
   BLOG STYLES
================================ */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.blog-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.blog-image {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.blog-content {
    padding: 1.5rem;
}

.blog-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.blog-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.blog-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* ================================
   PROJECT GENERATOR
================================ */
.project-form {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.project-preview {
    background: white;
    border: 1px solid var(--border-color);
    padding: 3rem;
    margin-top: 2rem;
    font-family: 'Times New Roman', serif;
    line-height: 2;
}

.project-preview .cover-page {
    text-align: center;
    page-break-after: always;
}

.project-preview .institution {
    font-size: 1.2rem;
    text-transform: uppercase;
    margin-bottom: 3rem;
}

.project-preview .project-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 2rem 0;
    text-transform: uppercase;
}

.project-preview .author-info {
    margin: 3rem 0;
}

.project-preview .declaration,
.project-preview .certification,
.project-preview .dedication,
.project-preview .acknowledgement {
    page-break-after: always;
}

/* ================================
   ALERTS
================================ */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.alert-warning {
    background: rgba(255, 152, 0, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(255, 152, 0, 0.3);
}

/* ================================
   MODAL
================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* ================================
   FOOTER
================================ */
.site-footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-widget h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget li {
    margin-bottom: 0.5rem;
}

.footer-widget a {
    color: rgba(255,255,255,0.7);
}

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

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    text-align: center;
    color: rgba(255,255,255,0.6);
}

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard {
        flex-direction: column;
    }
    
    .nav-menu {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .chapters-grid {
        grid-template-columns: 1fr;
    }
    
    .certificate-preview {
        padding: 30px;
    }
    
    .certificate-title {
        font-size: 2rem;
    }
    
    .certificate-recipient {
        font-size: 1.75rem;
    }
}

/* ================================
   PRINT STYLES
================================ */
@media print {
    .sidebar,
    .site-header,
    .btn,
    .quiz-navigation {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    .certificate-preview {
        border: none;
        box-shadow: none;
    }
}
