/*
 Theme Name:   MYPPKI.COM (GeneratePress Child)
 Theme URI:    https://myppki.com
 Description:  Portal bahan pembelajaran untuk guru.
 Author:       Afnan
 Author URI:   https://myppki.com
 Template:     generatepress
 Version:      2.0.0 (27/11/2025)
 Text Domain:  myppki
*/

/**
 * MYPPKI.COM - Complete Stylesheet
 * Enhanced child theme for educational resource portal
 */

/* ======== CSS VARIABLES ======== */
:root {
    /* Brand Colors */
    --primary-color: #FF3366;
    --primary-light: #FF6699;
    --primary-dark: #CC0044;
    --accent-color: #FFB800;
    --accent-light: #FFCC33;
    
    /* Semantic Colors */
    --success-color: #00CC66;
    --warning-color: #FF9500;
    --danger-color: #dc2626;
    --info-color: #3399FF;
    
    /* Neutrals */
    --light-bg: #F5F5F5;
    --light-bg-2: #F0F0F0;
    --card-bg: #FFFFFF;
    --text-dark: #222222;
    --text-medium: #444444;
    --text-light: #999999;
    
    /* Borders & Shadows */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 20px;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    
    /* Layout */
    --container-width: 1280px;
    --container-padding: 20px;
    
    /* Transitions */
    --transition: all 0.3s ease;
    
    /* Typography */
    --font-family: 'Nunito', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ======== FONT LOADING ======== */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

/* Local font fallback if available */
@font-face {
    font-family: 'Nunito';
    src: url('../fonts/nunito.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ======== DASHICONS FIX ======== */
.dashicons {
    font-family: "Dashicons" !important;
    display: inline-block !important;
    line-height: 1 !important;
    font-weight: 400 !important;
    font-style: normal !important;
    vertical-align: middle !important;
    text-decoration: none !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Dashicons Context Sizing */
.material-no-image .dashicons {
    font-size: 48px !important;
    width: 48px !important;
    height: 48px !important;
    color: var(--text-light) !important;
}

.material-meta .dashicons,
.material-type .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    margin-right: 5px !important;
    color: var(--primary-color) !important;
}

.level-icon .dashicons {
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
}

.info-icon .dashicons {
    font-size: 30px !important;
    width: 30px !important;
    height: 30px !important;
}

/* ======== BASE STYLES ======== */
.myppki-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: var(--container-padding);
    font-family: var(--font-family);
}

.myppki-page {
    background-color: var(--light-bg);
}

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

.myppki-container a:hover,
.myppki-container a:focus {
    color: var(--primary-dark);
}

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

/* ======== UTILITY CLASSES ======== */
.hover-float {
    transition: var(--transition);
}

.hover-float.hovered {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ======== SECTION HEADERS ======== */
.section-header {
    position: relative;
    margin-bottom: 30px;
    text-align: center;
    padding-bottom: 15px;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.section-header h2 {
    font-size: 28px;
    margin: 0;
    color: var(--text-dark);
    font-weight: 800;
}

.section-description {
    color: var(--text-medium);
    margin-top: 5px;
    font-size: 16px;
}

/* ======== HERO SECTION ======== */
.myppki-hero {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #F8F9FA 0%, #E9ECEF 100%);
    border-radius: var(--border-radius);
    padding: 40px;
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero-content {
    flex: 1;
    padding-right: 20px;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.hero-content h1 span {
    color: var(--primary-color);
}

.hero-content p {
    font-size: 18px;
    color: var(--text-medium);
    margin-bottom: 25px;
}

.hero-image {
    flex: 1;
    text-align: right;
}

.hero-image img {
    max-width: 400px;
}

/* ======== SEARCH SECTION ======== */
.myppki-search {
    position: relative;
    max-width: 600px;
    margin: 0 auto 50px auto;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-form input[type="search"],
.search-form input[type="text"] {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 16px;
    border: 2px solid var(--light-bg-2);
    border-radius: var(--border-radius);
    background-color: var(--card-bg);
    transition: var(--transition);
}

.search-form input[type="search"]:focus,
.search-form input[type="text"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: var(--shadow);
}

.search-form button[type="submit"] {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.search-form button[type="submit"]:hover {
    transform: translateY(-50%) scale(1.1);
}

.search-form button .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

/* Search Clear Button */
.search-clear {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    display: none;
    transition: var(--transition);
}

.search-clear:hover {
    color: var(--primary-color);
}

/* Search Results Preview */
.search-results-preview {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    margin-top: 8px;
}

.search-preview-results {
    padding: 8px;
}

.search-result-item {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    transition: var(--transition);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #1f2937;
}

.search-result-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
}

.search-result-item h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.search-result-item:hover {
    background: #f9fafb;
}

/* ======== MATERIAL CARDS ======== */
.material-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 30px;
    transition: var(--transition);
}

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

.material-no-image {
    background-color: var(--light-bg-2);
    border-radius: var(--border-radius);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.material-card img {
    border-radius: var(--border-radius);
    margin-bottom: 15px;
}

.material-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.material-card h3 a {
    color: var(--text-dark);
}

.material-card h3 a:hover {
    color: var(--primary-color);
}

.material-meta {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.material-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.material-excerpt {
    font-size: 16px;
    color: var(--text-medium);
    margin-bottom: 15px;
    line-height: 1.6;
}

.material-type {
    font-size: 14px;
    color: var(--text-light);
}

.material-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #E6005C 100%);
    color: white;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(255, 51, 102, 0.3);
}

.material-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.4);
    color: white;
}

/* ======== LOADING SPINNER ======== */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.loading-spinner .dashicons {
    font-size: 32px !important;
    width: 32px !important;
    height: 32px !important;
    color: var(--primary-color) !important;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

/* ======== NOTIFICATIONS ======== */
.myppki-error-notification,
.myppki-success-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    display: none;
}

/* Error Notification */
.error-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fee2e2;
    border-left: 4px solid var(--danger-color);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.error-content .dashicons {
    color: var(--danger-color);
    font-size: 24px !important;
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0;
}

.error-message {
    color: #991b1b;
    font-weight: 600;
    flex: 1;
}

.error-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--danger-color);
    padding: 0;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: var(--transition);
}

.error-close:hover {
    color: #991b1b;
    transform: scale(1.1);
}

/* Success Notification */
.success-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #d1fae5;
    border-left: 4px solid var(--success-color);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.success-content .dashicons {
    color: #059669;
    font-size: 24px !important;
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0;
}

.success-message {
    color: #065f46;
    font-weight: 600;
}

/* ======== SKIP LINK (Accessibility) ======== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    border-radius: 0 0 4px 0;
    transition: var(--transition);
}

.skip-link.visible,
.skip-link:focus {
    top: 0;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ======== MOBILE MENU ======== */
body.menu-open {
    overflow: hidden;
}

.main-navigation.active {
    /* Add your active menu styles */
}

/* ======== SUBJECT/RESOURCE CARDS ======== */
.subject-card,
.resource-type-card {
    transition: var(--transition);
}

.subject-card.card-hover,
.resource-type-card.card-hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
}

.resource-type-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.2);
}

/* ======== NO RESULTS ======== */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 16px;
}

/* ======== RESPONSIVE DESIGN ======== */
@media (max-width: 992px) {
    .myppki-hero {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }

    .hero-content {
        padding-right: 0;
        margin-bottom: 20px;
    }

    .hero-image {
        text-align: center;
    }

    .hero-image img {
        max-width: 300px;
    }

    .hero-content h1 {
        font-size: 36px;
    }

    .material-card {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    :root {
        --container-padding: 15px;
    }

    .hero-content h1 {
        font-size: 30px;
    }

    .hero-content p {
        font-size: 16px;
    }

    .section-header h2 {
        font-size: 24px;
    }
}

@media (max-width: 640px) {
    .myppki-error-notification,
    .myppki-success-notification {
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .error-content,
    .success-content {
        padding: 12px;
        gap: 8px;
    }

    .search-results-preview {
        max-height: 300px;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 24px;
    }

    .hero-content p {
        font-size: 14px;
    }

    .search-form input[type="search"],
    .search-form input[type="text"] {
        padding: 12px 45px 12px 15px;
        font-size: 14px;
    }

    .material-card h3 {
        font-size: 18px;
    }

    .material-excerpt {
        font-size: 14px;
    }
}