:root {
    --primary: #6C3483;
    --secondary: #F39C12;
    --accent: #1ABC9C;
    --dark: #1a1a2e;
    --light: #f8f9fa;
    --white: #ffffff;
    --gray: #6c757d;
    --danger: #e74c3c;
    --success: #27ae60;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light);
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Navbar */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 2rem;
}

.navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.navbar .brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar .brand .gem-icon {
    font-size: 1.8rem;
}

.navbar .nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.navbar .nav-links a {
    font-weight: 500;
    color: var(--gray);
    transition: color 0.3s;
    padding: 0.5rem 0;
    position: relative;
}

.navbar .nav-links a:hover,
.navbar .nav-links a.active {
    color: var(--primary);
}

.navbar .nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--secondary);
    border-radius: 2px;
}

.navbar .hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}

.navbar .hamburger span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: 0.3s;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #8E44AD 50%, var(--accent) 100%);
    color: var(--white);
    padding: 5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: drift 20s linear infinite;
}

@keyframes drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 30px); }
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    position: relative;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    position: relative;
}

/* Verification Box */
.verify-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    max-width: 550px;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    position: relative;
}

.verify-box h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.verify-box input[type="text"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    margin-bottom: 1rem;
}

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

.btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    width: 100%;
}

.btn-primary:hover {
    background: #5B2C6F;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108,52,131,0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover {
    background: #E67E22;
}

.btn-accent {
    background: var(--accent);
    color: var(--white);
}

.btn-accent:hover {
    background: #16A085;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #C0392B;
}

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

/* Certificate Result */
.cert-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: var(--radius);
    display: none;
}

.cert-result.found {
    display: block;
    background: #d5f5e3;
    border: 2px solid var(--success);
}

.cert-result.not-found {
    display: block;
    background: #fadbd8;
    border: 2px solid var(--danger);
}

.cert-result h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.cert-result .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.cert-result .detail-row:last-child {
    border-bottom: none;
}

.cert-result .detail-label {
    font-weight: 600;
    color: #1a1a1a;
}

.cert-result .detail-value {
    font-weight: 500;
    color: #1a1a1a;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-valid {
    background: #d5f5e3;
    color: var(--success);
}

.status-expired {
    background: #fadbd8;
    color: var(--danger);
}

/* Sections */
.section {
    padding: 4rem 2rem;
}

.section .container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--gray);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.card h3 {
    color: var(--primary);
    margin-bottom: 0.8rem;
}

.card p {
    color: var(--gray);
}

/* Steps */
.steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    text-align: center;
    max-width: 220px;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step h4 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.step p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Form */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Footer */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 3rem 2rem 1.5rem;
}

.footer .container {
    max-width: 1200px;
    margin: 0 auto;
}

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

.footer h4 {
    margin-bottom: 1rem;
    color: var(--secondary);
}

.footer p, .footer a {
    color: rgba(255,255,255,0.7);
    line-height: 1.8;
}

.footer a:hover {
    color: var(--secondary);
}

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

/* Alert Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #d5f5e3;
    color: #1e8449;
    border: 1px solid #27ae60;
}

.alert-danger {
    background: #fadbd8;
    color: #922b21;
    border: 1px solid #e74c3c;
}

.alert-info {
    background: #d6eaf8;
    color: #1a5276;
    border: 1px solid #3498db;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, #8E44AD 100%);
    color: var(--white);
    padding: 3rem 2rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

th, td {
    padding: 12px 16px;
    text-align: left;
}

th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
}

tr:nth-child(even) {
    background: #f8f9fa;
}

tr:hover {
    background: #eef2f7;
}

/* ===== ADMIN STYLES ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--dark);
    color: var(--white);
    padding: 1.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s;
}

.admin-sidebar .sidebar-brand {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
}

.admin-sidebar .sidebar-brand h3 {
    color: var(--secondary);
    font-size: 1.2rem;
}

.admin-sidebar .sidebar-brand p {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
}

.admin-sidebar .nav-menu {
    list-style: none;
}

.admin-sidebar .nav-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 1.5rem;
    color: rgba(255,255,255,0.7);
    transition: all 0.3s;
    font-size: 0.95rem;
}

.admin-sidebar .nav-menu li a:hover,
.admin-sidebar .nav-menu li a.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border-left: 3px solid var(--secondary);
}

.admin-sidebar .nav-menu li a .nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.admin-main {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
    background: #f0f2f5;
    min-height: 100vh;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.admin-topbar h2 {
    color: var(--dark);
    font-size: 1.3rem;
}

/* Stat Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.stat-card .stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-icon.purple {
    background: rgba(108,52,131,0.15);
    color: var(--primary);
}

.stat-card .stat-icon.orange {
    background: rgba(243,156,18,0.15);
    color: var(--secondary);
}

.stat-card .stat-icon.green {
    background: rgba(26,188,156,0.15);
    color: var(--accent);
}

.stat-card .stat-icon.red {
    background: rgba(231,76,60,0.15);
    color: var(--danger);
}

.stat-card .stat-info h3 {
    font-size: 1.8rem;
    color: var(--dark);
}

.stat-card .stat-info p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Admin Content Card */
.admin-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.admin-card-header h3 {
    color: var(--dark);
}

/* Color picker */
.form-group input[type="color"] {
    width: 60px;
    height: 45px;
    padding: 2px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #8E44AD 100%);
}

.login-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-box .login-subtitle {
    text-align: center;
    color: var(--gray);
    margin-bottom: 2rem;
}

.login-box .login-icon {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Navbar */
    .navbar {
        padding: 0 1rem;
    }
    .navbar .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 1rem 1.5rem;
        box-shadow: var(--shadow);
        gap: 0;
        z-index: 999;
    }
    .navbar .nav-links.active {
        display: flex;
    }
    .navbar .nav-links a {
        padding: 0.8rem 0;
        border-bottom: 1px solid #f0f0f0;
        display: block;
    }
    .navbar .hamburger {
        display: flex;
    }

    /* Hero */
    .hero {
        padding: 3rem 1rem;
    }
    .hero h1 {
        font-size: 1.9rem;
    }
    .hero p {
        font-size: 1rem;
    }

    /* Verify box */
    .verify-box {
        padding: 1.4rem;
    }
    .cert-result .detail-row {
        flex-direction: column;
        gap: 2px;
    }
    .cert-result .detail-label {
        font-size: .85rem;
    }
    .cert-result .detail-value {
        font-size: .9rem;
        padding-left: .5rem;
    }

    /* Sections */
    .section {
        padding: 2.5rem 1rem;
    }
    .section-title {
        font-size: 1.6rem;
    }
    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    /* Cards */
    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 1.2rem;
    }

    /* Steps */
    .steps {
        flex-direction: column;
        align-items: center;
    }

    /* Page header */
    .page-header {
        padding: 2rem 1rem;
    }
    .page-header h1 {
        font-size: 1.7rem;
    }
    .page-header p {
        font-size: .95rem;
    }

    /* Footer */
    .footer {
        padding: 2rem 1rem 1rem;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Tables */
    table {
        font-size: .85rem;
    }
    th, td {
        padding: 10px 10px;
    }

    /* Admin */
    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 200;
    }
    .admin-sidebar.active {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
        padding: 1rem;
    }
    .sidebar-toggle {
        display: inline-block;
    }
    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }
    .admin-topbar {
        padding: .8rem 1rem;
        flex-wrap: wrap;
        gap: .5rem;
    }
    .admin-card {
        padding: 1rem;
    }
    .admin-card-header {
        flex-wrap: wrap;
        gap: .5rem;
    }
    .form-row {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .navbar .brand {
        font-size: 1.1rem;
    }
    .navbar .brand img {
        height: 30px !important;
    }
    .hero h1 {
        font-size: 1.5rem;
    }
    .verify-box {
        padding: 1.1rem;
    }
    .verify-box h3 {
        font-size: 1.1rem;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
    .stat-grid {
        grid-template-columns: 1fr;
    }
    .btn {
        padding: 11px 20px;
        font-size: .95rem;
    }
    .cert-result h4 {
        font-size: 1rem;
    }
    /* Gem grid on homepage */
    .gem-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: .8rem !important;
    }
    .gem-item {
        height: 130px !important;
        padding: .8rem .4rem !important;
    }
    .gem-item .gem-img-wrap {
        width: 60px !important;
        height: 60px !important;
    }
    .gem-item .gem-img-wrap img {
        width: 60px !important;
        height: 60px !important;
    }
    .gem-item .gem-emoji {
        font-size: 2rem !important;
    }
    .gem-item h4 {
        font-size: .78rem !important;
    }
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
    }
}
