/* ============================================
   COMMON CSS - SK SMART CLASSES
   Used across all pages: ICT Tools, Competition, Student Corner
   ============================================ */

/* ===== RESET & VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00563f;
    --primary-light: #087f5b;
    --secondary: #1565c0;
    --secondary-light: #1683e8;
    --accent: #00a8cc;
    --bg-soft: #e8f5f1;
    --bg-blue-soft: #eef6ff;
    --bg-light: #f5faf8;
    --white: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #2c3e50;
    --shadow-sm: 0 8px 20px rgba(0, 30, 20, 0.06);
    --shadow-md: 0 18px 36px -10px rgba(0, 40, 30, 0.12);
    --shadow-lg: 0 30px 50px -16px rgba(0, 50, 40, 0.20);
    --radius-card: 16px;
    --transition: 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

body {
    font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== HEADER & FOOTER (dynamic) ===== */
#header,
#footer {
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}



/* ===== CONTAINER ===== */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
    width: 100%;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    font-size: 0.9rem;
    padding: 0.8rem 0 0.2rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb span {
    color: var(--text-muted);
}

/* ===== HERO SECTION ===== */
.hero {
    position: relative;
    background: linear-gradient(135deg, #eef6ff 0%, #e8f5f1 100%);
    border-radius: 24px;
    padding: 2.4rem 2rem 2.8rem;
    margin: 0.4rem 0 1.8rem;
    overflow: hidden;
    box-shadow: 0 12px 40px -12px rgba(0, 40, 30, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.hero-inner {
    position: relative;
    z-index: 3;
    max-width: 820px;
}

.hero h1 {
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(145deg, #00563f, #1565c0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    margin-bottom: 0.25rem;
}

.hero h1 i {
    -webkit-text-fill-color: var(--primary);
    background: none;
    margin-right: 0.3rem;
}

.hero p.sub {
    font-size: 1.2rem;
    color: #1a3b4a;
    font-weight: 400;
    margin-bottom: 0.3rem;
}

.hero .desc {
    font-size: 1rem;
    color: #1e3f4a;
    max-width: 700px;
    line-height: 1.6;
    margin: 0.6rem 0 1rem;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.9rem;
    margin: 0.8rem 0 0.2rem;
}

.hero-badges span {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(4px);
    padding: 0.25rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #00563f;
    border: 1px solid rgba(0, 86, 63, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

/* floating shapes for hero */
.hero-shapes {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.hero-shapes .circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 168, 204, 0.05);
    animation: float 14s infinite alternate ease-in-out;
}

.hero-shapes .c1 {
    width: 200px;
    height: 200px;
    top: -50px;
    right: -30px;
}

.hero-shapes .c2 {
    width: 130px;
    height: 130px;
    bottom: -20px;
    left: 5%;
    background: rgba(0, 86, 63, 0.03);
    animation-duration: 18s;
}

.hero-shapes .c3 {
    width: 80px;
    height: 80px;
    top: 20%;
    right: 15%;
    background: rgba(21, 101, 192, 0.03);
    animation-duration: 16s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-15px, 15px) scale(1.04);
    }
}

/* ===== SECTION TITLE ===== */
.section-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 2rem 0 1.2rem;
    border-left: 6px solid var(--primary);
    padding-left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--primary-light);
    font-size: 1.5rem;
}

/* ===== GRID CARDS (common) ===== */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
}

.grid-cards .card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    border-radius: var(--radius-card);
    padding: 0.9rem 0.6rem;
    text-align: center;
    box-shadow: 0 8px 20px -6px rgba(0, 30, 20, 0.06),
        0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transform: perspective(600px) rotateX(0) rotateY(0) scale(1);
    transform-style: preserve-3d;
    position: relative;
}

.grid-cards .card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-card);
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 168, 204, 0.15), rgba(0, 86, 63, 0.04));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: 0.3s;
    opacity: 0.3;
}

.grid-cards .card:hover {
    transform: perspective(700px) rotateX(1deg) rotateY(1.5deg) scale(1.02) translateY(-4px);
    box-shadow: 0 16px 32px -12px rgba(0, 50, 40, 0.15),
        0 0 0 1px rgba(0, 86, 63, 0.04);
    background: rgba(255, 255, 255, 0.94);
}

.grid-cards .card:hover::before {
    opacity: 1;
    background: linear-gradient(135deg, #00a8cc, #087f5b);
}

.grid-cards .card a {
    text-decoration: none;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    width: 100%;
    height: 100%;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.2rem 0.1rem;
    line-height: 1.3;
}

.grid-cards .card a .icon {
    font-size: 1.8rem;
    line-height: 1.2;
    margin-bottom: 0.1rem;
    transition: 0.3s;
}

.grid-cards .card:hover a .icon {
    transform: scale(1.08) rotate(1deg);
}

.grid-cards .card a .title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #132b3f;
}

.grid-cards .card .cta {
    display: inline-block;
    margin-top: 0.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(0, 86, 63, 0.04);
    padding: 0.1rem 0.8rem;
    border-radius: 30px;
    transition: 0.3s;
    border: 1px solid rgba(0, 86, 63, 0.04);
}

.grid-cards .card:hover .cta {
    background: var(--primary);
    color: white;
    transform: translateX(3px);
}

/* ===== SEARCH (for ICT Tools page) ===== */
.search-wrap {
    position: relative;
    margin-top: -1.2rem;
    margin-bottom: 2.2rem;
    z-index: 10;
    display: flex;
    justify-content: center;
}

.search-box {
    background: var(--white);
    border-radius: 60px;
    padding: 0.1rem 0.1rem 0.1rem 1.8rem;
    box-shadow: 0 12px 30px -10px rgba(0, 40, 30, 0.08), 0 0 0 1px rgba(0, 86, 63, 0.06);
    display: flex;
    align-items: center;
    max-width: 680px;
    width: 100%;
    transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.search-box:focus-within {
    box-shadow: 0 16px 40px -12px rgba(0, 86, 63, 0.15), 0 0 0 3px rgba(0, 86, 63, 0.08);
    transform: scale(1.01);
}

.search-box i {
    color: var(--primary-light);
    font-size: 1.2rem;
    opacity: 0.7;
}

.search-box input {
    border: none;
    padding: 0.9rem 0.8rem;
    font-size: 1rem;
    width: 100%;
    background: transparent;
    outline: none;
    color: var(--text-dark);
    font-weight: 500;
}

.search-box input::placeholder {
    color: #8a9da8;
    font-weight: 400;
}

.search-box .search-btn {
    background: linear-gradient(145deg, #00563f, #087f5b);
    border: none;
    color: white;
    padding: 0.7rem 1.8rem;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.25s;
    white-space: nowrap;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.search-box .search-btn:hover {
    transform: scale(0.97);
    background: #004e38;
}

/* ===== TOOLS HEADER ===== */
.tools-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    margin: 1.2rem 0 1.8rem;
}

.tools-header h2 {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.3px;
}

.tools-header h2 i {
    color: var(--primary);
    margin-right: 0.4rem;
}

.tools-header .count {
    background: var(--white);
    padding: 0.3rem 1.2rem;
    border-radius: 40px;
    font-weight: 600;
    color: var(--primary);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 86, 63, 0.06);
}

/* ===== CATEGORY SECTION ===== */
.category-section {
    margin-bottom: 2.8rem;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    border-left: 6px solid var(--primary);
    padding-left: 0.9rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.category-title i {
    color: var(--primary-light);
}

/* ===== CARD GRID (for ICT Tools) ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.6rem;
}

.card-grid .card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    border-radius: var(--radius-card);
    padding: 1.2rem 0.8rem 0.9rem;
    text-align: center;
    box-shadow: 0 12px 28px -10px rgba(0, 30, 20, 0.06),
        0 0 0 1px rgba(255, 255, 255, 0.8) inset,
        0 0 0 1px rgba(0, 0, 0, 0.02);
    transition: var(--transition);
    transform: perspective(800px) rotateX(0) rotateY(0) scale(1);
    transform-style: preserve-3d;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.5);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card-grid .card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-card);
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 168, 204, 0.2), rgba(0, 86, 63, 0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: 0.4s;
    opacity: 0.4;
}

.card-grid .card:hover {
    transform: perspective(900px) rotateX(1.5deg) rotateY(2.5deg) scale(1.02) translateY(-6px);
    box-shadow: 0 28px 48px -16px rgba(0, 50, 40, 0.18),
        0 0 0 1px rgba(0, 86, 63, 0.04),
        0 0 0 2px rgba(0, 168, 204, 0.08);
    background: rgba(255, 255, 255, 0.92);
}

.card-grid .card:hover::before {
    opacity: 1;
    background: linear-gradient(135deg, #00a8cc, #087f5b);
}

.card-grid .card a {
    text-decoration: none;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: 100%;
    height: 100%;
    padding: 0.2rem 0.1rem;
}

.card-grid .card a .icon {
    font-size: 2.3rem;
    line-height: 1.2;
    margin-bottom: 0.2rem;
    transition: 0.3s;
    filter: drop-shadow(0 4px 8px rgba(0, 30, 20, 0.04));
}

.card-grid .card:hover a .icon {
    transform: scale(1.1) rotate(2deg);
}

.card-grid .card a .title {
    font-weight: 600;
    font-size: 0.98rem;
    color: #132b3f;
    line-height: 1.3;
}

.card-grid .card a .desc {
    font-size: 0.75rem;
    color: #3d5a6b;
    opacity: 0.85;
    max-width: 180px;
    margin: 0.1rem auto 0.3rem;
}

.card-grid .card .cta {
    display: inline-block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(0, 86, 63, 0.04);
    padding: 0.2rem 1rem;
    border-radius: 40px;
    transition: 0.3s;
    border: 1px solid rgba(0, 86, 63, 0.04);
}

.card-grid .card:hover .cta {
    background: var(--primary);
    color: white;
    transform: translateX(4px);
}

.card-grid .card .badge {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 0.6rem;
    background: rgba(0, 168, 204, 0.1);
    color: #00563f;
    padding: 0.15rem 0.7rem;
    border-radius: 40px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid rgba(0, 86, 63, 0.04);
}

/* ===== NO RESULT ===== */
.no-result {
    text-align: center;
    padding: 3rem 0;
    font-size: 1.3rem;
    color: var(--text-muted);
    display: none;
    width: 100%;
}

.no-result i {
    font-size: 2.5rem;
    color: var(--primary-light);
    opacity: 0.3;
    margin-bottom: 0.6rem;
}

/* ===== BACK TO TOP ===== */
.back-top {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    background: var(--primary);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 8px 20px rgba(0, 86, 63, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    cursor: pointer;
    border: none;
    z-index: 99;
}

.back-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-top:hover {
    background: #004e38;
    transform: scale(1.05);
}

/* ===== RESPONSIVE COMMON ===== */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.2rem 1.5rem;
    }

    .hero {
        padding: 1.8rem 1.5rem 2rem;
        border-radius: 20px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p.sub {
        font-size: 1.05rem;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
        gap: 1.4rem;
    }

    .card-grid .card {
        --radius-card: 14px;
        padding: 1rem 0.6rem 0.8rem;
    }

    .card-grid .card a .icon {
        font-size: 2rem;
    }

    .card-grid .card a .title {
        font-size: 0.9rem;
    }

    .grid-cards {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 1rem;
    }

    .grid-cards .card {
        --radius-card: 14px;
        padding: 0.7rem 0.4rem;
    }

    .grid-cards .card a {
        font-size: 0.85rem;
    }

    .grid-cards .card a .icon {
        font-size: 1.6rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .search-box {
        border-radius: 50px;
        padding: 0.1rem 0.1rem 0.1rem 1.4rem;
    }

    .search-box input {
        padding: 0.7rem 0.6rem;
        font-size: 0.9rem;
    }

    .search-box .search-btn {
        padding: 0.6rem 1.4rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 767px) {
    :root {
        --radius-card: 12px;
    }

    .container {
        padding: 0 0.8rem 1rem;
    }

   

    

    .hero {
        padding: 1rem 0.8rem 1.4rem;
        border-radius: 16px;
        margin: 0 0 1.2rem;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero p.sub {
        font-size: 0.9rem;
    }

    .hero .desc {
        font-size: 0.82rem;
        margin: 0.4rem 0 0.6rem;
    }

    .hero-badges span {
        font-size: 0.7rem;
        padding: 0.15rem 0.7rem;
    }

    .hero-shapes .c1 {
        width: 120px;
        height: 120px;
        top: -30px;
        right: -20px;
    }

    .hero-shapes .c2 {
        width: 80px;
        height: 80px;
        bottom: -10px;
        left: 5%;
    }

    .hero-shapes .c3 {
        width: 60px;
        height: 60px;
        top: 20%;
        right: 10%;
    }

    .breadcrumb {
        font-size: 0.75rem;
        padding: 0.4rem 0;
    }

    .section-title {
        font-size: 1.2rem;
        border-left-width: 4px;
        padding-left: 0.6rem;
        margin: 1.2rem 0 0.8rem;
    }

    .section-title i {
        font-size: 1.1rem;
    }

    .card-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }

    .card-grid .card {
        --radius-card: 10px;
        padding: 0.8rem 0.4rem 0.6rem;
    }

    .card-grid .card a .icon {
        font-size: 1.7rem;
    }

    .card-grid .card a .title {
        font-size: 0.8rem;
    }

    .card-grid .card a .desc {
        font-size: 0.65rem;
        max-width: 140px;
    }

    .card-grid .card .cta {
        font-size: 0.65rem;
        padding: 0.1rem 0.7rem;
    }

    .card-grid .card .badge {
        font-size: 0.5rem;
        top: 4px;
        right: 6px;
        padding: 0.1rem 0.5rem;
    }

    .grid-cards {
        grid-template-columns: 1fr 1fr;
        gap: 0.7rem;
    }

    .grid-cards .card {
        --radius-card: 10px;
        padding: 0.6rem 0.3rem;
    }

    .grid-cards .card a {
        font-size: 0.78rem;
    }

    .grid-cards .card a .icon {
        font-size: 1.4rem;
    }

    .grid-cards .card .cta {
        font-size: 0.6rem;
        padding: 0.05rem 0.5rem;
    }

    .tools-header h2 {
        font-size: 1.3rem;
    }

    .tools-header .count {
        font-size: 0.75rem;
        padding: 0.2rem 0.8rem;
    }

    .category-title {
        font-size: 1.1rem;
        border-left-width: 4px;
        padding-left: 0.6rem;
        margin-bottom: 0.8rem;
    }

    .category-section {
        margin-bottom: 1.8rem;
    }

    .search-wrap {
        margin-top: -0.8rem;
        margin-bottom: 1.2rem;
    }

    .search-box {
        border-radius: 40px;
        padding: 0.1rem 0.1rem 0.1rem 1rem;
        flex-wrap: wrap;
    }

    .search-box input {
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
    }

    .search-box .search-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        width: 100%;
        border-radius: 40px;
        margin-top: 0.2rem;
        justify-content: center;
    }

    .search-box i {
        font-size: 1rem;
    }

    .no-result {
        font-size: 1rem;
        padding: 2rem 0;
    }

    .back-top {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        bottom: 1rem;
        right: 0.8rem;
    }
}

@media (max-width: 420px) {
    .card-grid {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

    .grid-cards {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .hero h1 {
        font-size: 1.4rem;
    }

    .hero p.sub {
        font-size: 0.85rem;
    }

    .hero .desc {
        font-size: 0.78rem;
    }

    .card-grid .card {
        --radius-card: 8px;
        padding: 0.7rem 0.3rem 0.5rem;
    }

    .card-grid .card a .icon {
        font-size: 1.5rem;
    }

    .card-grid .card a .title {
        font-size: 0.75rem;
    }

    .card-grid .card .badge {
        display: none;
    }

    .grid-cards .card a {
        font-size: 0.85rem;
    }

    .tools-header h2 {
        font-size: 1.1rem;
    }

    .search-box input {
        font-size: 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .card-grid .card,
    .grid-cards .card,
    .hero-shapes .circle,
    .search-box,
    .back-top {
        animation: none;
        transition: none;
    }

    .card-grid .card:hover,
    .grid-cards .card:hover {
        transform: none !important;
    }
}