/* =========================
   GLOBAL STYLES
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f6f8fc;
    color: #172033;
    line-height: 1.6;
    transition: 0.3s;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input,
select {
    font-family: inherit;
}


/* =========================
   HEADER
========================= */

.header {
    width: 100%;
    min-height: 75px;
    padding: 15px 7%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: #172033;
}

.logo span {
    color: #6c4df6;
}

.navbar {
    display: flex;
    gap: 30px;
    align-items: center;
}

.navbar a {
    font-size: 15px;
    font-weight: 600;
    transition: 0.3s;
}

.navbar a:hover {
    color: #6c4df6;
}

.dark-btn {
    border: none;
    background: #f0edff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 19px;
}
.logout-btn {
    display: none;
    border: none;
    background: #6c4df6;
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
}

.logout-btn:hover {
    background: #5639df;
}

/* =========================
   HERO
========================= */

.hero {
    min-height: 600px;
    padding: 80px 7%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    background: linear-gradient(135deg, #f5f2ff, #eef6ff);
}

.hero-content {
    max-width: 650px;
}

.hero-small {
    color: #6c4df6;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.hero h1 {
    font-size: 58px;
    line-height: 1.1;
    margin-bottom: 25px;
}

.hero h1 span {
    color: #6c4df6;
}

.hero-content > p:not(.hero-small) {
    color: #5d6678;
    font-size: 18px;
    max-width: 570px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    margin-top: 35px;
}

.btn {
    display: inline-block;
    border: none;
    padding: 13px 23px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.primary-btn {
    background: #6c4df6;
    color: white;
}

.primary-btn:hover {
    background: #5639df;
    transform: translateY(-2px);
}

.secondary-btn {
    background: white;
    color: #6c4df6;
    border: 1px solid #dcd6ff;
}

.secondary-btn:hover {
    background: #f0edff;
    transform: translateY(-2px);
}

.hero-image {
    width: 400px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-card {
    width: 320px;
    padding: 45px 30px;
    text-align: center;
    background: white;
    border-radius: 25px;
    box-shadow: 0 20px 50px rgba(70, 50, 150, 0.15);
    animation: floatCard 3s ease-in-out infinite;
}

.hero-icon {
    font-size: 70px;
    margin-bottom: 20px;
}

.hero-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.hero-card p {
    color: #697386;
}

@keyframes floatCard {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}


/* =========================
   STATS
========================= */

.stats {
    padding: 35px 7%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    background: white;
}

.stat-card {
    text-align: center;
    padding: 20px;
}

.stat-card h2 {
    font-size: 30px;
    color: #6c4df6;
}

.stat-card p {
    color: #687286;
}


/* =========================
   SECTION HEADING
========================= */

.events-section,
.match-section,
.dashboard-section {
    padding: 90px 7%;
}

.section-heading {
    text-align: center;
    margin-bottom: 40px;
}

.section-heading p {
    color: #6c4df6;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
}

.section-heading h2 {
    font-size: 38px;
    margin: 8px 0;
}

.section-heading span {
    color: #697386;
}


/* =========================
   SEARCH
========================= */

.search-area {
    max-width: 700px;
    margin: 0 auto 25px;
}

.search-area input {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid #dfe3ec;
    border-radius: 12px;
    outline: none;
    background: white;
    font-size: 15px;
}

.search-area input:focus {
    border-color: #6c4df6;
    box-shadow: 0 0 0 3px rgba(108, 77, 246, 0.1);
}


/* =========================
   FILTER BUTTONS
========================= */

.filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.filter-btn {
    border: 1px solid #dddfe8;
    background: white;
    color: #4f596b;
    padding: 10px 17px;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
    background: #6c4df6;
    color: white;
    border-color: #6c4df6;
}


/* =========================
   EVENT CARDS
========================= */

.events-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.event-card {
    background: white;
    border-radius: 18px;
    padding: 25px;
    border: 1px solid #e8eaf0;
    box-shadow: 0 8px 25px rgba(25, 30, 50, 0.06);
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.event-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 15px 35px rgba(25, 30, 50, 0.12);
}

.event-category {
    display: inline-block;
    padding: 6px 11px;
    border-radius: 20px;
    background: #f0edff;
    color: #6c4df6;
    font-size: 12px;
    font-weight: bold;
}

.event-card h3 {
    margin: 18px 0 10px;
    font-size: 21px;
}

.event-description {
    color: #697386;
    font-size: 14px;
    margin-bottom: 18px;
}

.event-info {
    color: #596274;
    font-size: 14px;
    margin: 7px 0;
}

.match-badge {
    display: inline-block;
    margin: 15px 0;
    padding: 7px 12px;
    border-radius: 20px;
    background: #e8f8ef;
    color: #15803d;
    font-size: 13px;
    font-weight: bold;
}

.countdown {
    margin: 10px 0;
    padding: 10px;
    border-radius: 8px;
    background: #f7f8fb;
    text-align: center;
    font-size: 13px;
    color: #5c6575;
}

.event-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.event-actions button {
    flex: 1;
}

.save-btn {
    border: 1px solid #dddfe8;
    background: white;
    color: #555f71;
    border-radius: 9px;
    cursor: pointer;
    font-weight: bold;
}

.save-btn:hover {
    background: #fff0f4;
    color: #e63969;
}


/* =========================
   MATCH SECTION
========================= */

.match-section {
    background: linear-gradient(135deg, #f0edff, #edf6ff);
}

.match-box {
    max-width: 750px;
    margin: auto;
    padding: 35px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(50, 40, 120, 0.1);
    text-align: center;
}

.match-box h3 {
    font-size: 23px;
    margin-bottom: 25px;
}

.interest-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.interest-options label {
    padding: 14px;
    border: 1px solid #e1e3eb;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: 0.3s;
}

.interest-options label:hover {
    border-color: #6c4df6;
    background: #f8f6ff;
}

.interest-options input {
    margin-right: 8px;
}

.match-result {
    margin-top: 25px;
}

.match-result-card {
    padding: 20px;
    border-radius: 12px;
    background: #f5f2ff;
}

.match-result-card h3 {
    color: #6c4df6;
    margin-bottom: 5px;
}

.match-percentage {
    font-size: 30px;
    font-weight: bold;
    color: #15803d;
}


/* =========================
   MODAL / REGISTRATION
========================= */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    inset: 0;
    background: rgba(15, 20, 35, 0.65);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    padding: 35px;
    border-radius: 18px;
    position: relative;
}

.modal-content h2 {
    margin-bottom: 8px;
}

.modal-content > p {
    color: #6c4df6;
    font-weight: bold;
    margin-bottom: 25px;
}

.close-btn {
    position: absolute;
    right: 18px;
    top: 12px;
    border: none;
    background: transparent;
    font-size: 30px;
    cursor: pointer;
    color: #596274;
}

.modal-content label {
    display: block;
    margin: 14px 0 6px;
    font-size: 14px;
    font-weight: bold;
}

.modal-content input,
.modal-content select {
    width: 100%;
    padding: 13px;
    border: 1px solid #dfe3ec;
    border-radius: 9px;
    outline: none;
}

.modal-content input:focus,
.modal-content select:focus {
    border-color: #6c4df6;
}

.modal-content form button {
    width: 100%;
    margin-top: 20px;
}

#registrationMessage {
    margin-top: 15px;
    text-align: center;
    font-weight: bold;
}


/* =========================
   DASHBOARD
========================= */

.dashboard-section {
    background: #ffffff;
}

.dashboard-stats {
    max-width: 1000px;
    margin: 0 auto 50px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.dashboard-card {
    text-align: center;
    padding: 30px;
    background: #f7f8fc;
    border-radius: 16px;
}

.dashboard-icon {
    font-size: 30px;
    margin-bottom: 8px;
}

.dashboard-card h2 {
    color: #6c4df6;
    font-size: 32px;
}

.dashboard-card p {
    color: #697386;
}

.dashboard-list {
    max-width: 1000px;
    margin: 25px auto;
    padding: 25px;
    background: #f7f8fc;
    border-radius: 15px;
}

.dashboard-list h3 {
    margin-bottom: 18px;
}

.empty-message {
    color: #7b8494;
}

.dashboard-event {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    border-left: 4px solid #6c4df6;
}


/* =========================
   FOOTER
========================= */

.footer {
    padding: 45px 7%;
    text-align: center;
    background: #172033;
    color: white;
}

.footer .logo {
    color: white;
    margin-bottom: 10px;
}

.footer p {
    color: #aeb6c5;
    margin: 5px;
}


/* =========================
   DARK MODE
========================= */

body.dark {
    background: #101522;
    color: #f1f3f7;
}

body.dark .header,
body.dark .stat-card,
body.dark .event-card,
body.dark .match-box,
body.dark .modal-content,
body.dark .dashboard-section {
    background: #181f2e;
}

body.dark .hero {
    background: linear-gradient(135deg, #151b2a, #1b2134);
}

body.dark .hero-card {
    background: #20283a;
}

body.dark .hero-content > p:not(.hero-small),
body.dark .section-heading span,
body.dark .event-description,
body.dark .event-info,
body.dark .stat-card p,
body.dark .dashboard-card p {
    color: #aeb6c5;
}

body.dark .search-area input,
body.dark .filter-btn,
body.dark .save-btn {
    background: #20283a;
    color: white;
    border-color: #343d51;
}

body.dark .match-section {
    background: #151b2a;
}

body.dark .interest-options label {
    border-color: #343d51;
    background: #20283a;
}

body.dark .dashboard-card,
body.dark .dashboard-list,
body.dark .countdown {
    background: #20283a;
}

body.dark .dashboard-event {
    background: #181f2e;
}

body.dark .modal-content input,
body.dark .modal-content select {
    background: #20283a;
    color: white;
    border-color: #343d51;
}


/* =========================
   RESPONSIVE DESIGN
========================= */

@media (max-width: 1000px) {

    .hero h1 {
        font-size: 45px;
    }

    .events-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-image {
        width: 320px;
    }
}


@media (max-width: 768px) {

    .header {
        padding: 15px 5%;
    }

    .navbar {
        gap: 12px;
    }

    .navbar a {
        font-size: 12px;
    }

    .hero {
        padding: 60px 5%;
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero h1 {
        font-size: 40px;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-image {
        width: 100%;
        height: auto;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 25px 5%;
    }

    .events-section,
    .match-section,
    .dashboard-section {
        padding: 60px 5%;
    }

    .section-heading h2 {
        font-size: 30px;
    }

    .events-container {
        grid-template-columns: 1fr;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 500px) {

    .header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .navbar {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero h1 {
        font-size: 34px;
    }

    .hero-content > p:not(.hero-small) {
        font-size: 16px;
    }


    .hero-card {
        width: 280px;
    }

    .interest-options {
        grid-template-columns: 1fr;
    }

    .match-box {
        padding: 25px 18px;
    }

    .event-actions {
        flex-direction: column;
    }

    .modal-content {
        padding: 25px 20px;
    }

    .stats {
        gap: 5px;
    }

    .stat-card h2 {
        font-size: 25px;
    }
}
/* ===== IMPROVED DARK MODE ===== */

body.dark {
    background: #0f172a;
    color: #f8fafc;
}

/* Header */
body.dark .header {
    background: #111827;
    box-shadow: 0 2px 15px rgba(0,0,0,0.4);
}

body.dark .logo,
body.dark .navbar a {
    color: #f8fafc;
}

/* Stats Section */
body.dark .stats {
    background: #111827;
}

body.dark .stat-card {
    background: #1e293b;
}

/* Cards */
body.dark .event-card,
body.dark .match-box,
body.dark .modal-content,
body.dark .hero-card,
body.dark .dashboard-event {
    background: #1e293b;
    color: #f8fafc;
    border-color: #334155;
}

/* Inputs */
body.dark input,
body.dark select {
    background: #0f172a;
    color: white;
    border: 1px solid #334155;
}

/* Dashboard */
body.dark .dashboard-section,
body.dark .dashboard-card,
body.dark .dashboard-list {
    background: #111827;
}

/* Match Result */
body.dark .match-result-card {
    background: #1e293b;
}

/* Buttons */
body.dark .secondary-btn,
body.dark .save-btn,
body.dark .filter-btn {
    background: #1e293b;
    color: white;
    border-color: #334155;
}

/* Footer */
body.dark .footer {
    background: #020617;
}

/* Text Colors */
body.dark p,
body.dark span,
body.dark h1,
body.dark h2,
body.dark h3,
body.dark h4,
body.dark h5,
body.dark h6 {
    color: inherit;
}
/* =========================
   FINAL RESPONSIVE FIXES
========================= */

/* Prevent horizontal scrolling */
html,
body {
    width: 100%;
    overflow-x: hidden;
}

/* Make media responsive */
img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

/* Better responsive heading sizes */
.hero h1 {
    font-size: clamp(34px, 6vw, 58px);
}

.section-heading h2 {
    font-size: clamp(28px, 4vw, 38px);
}


/* =========================
   TABLET IMPROVEMENTS
========================= */

@media (max-width: 1000px) {

    .hero {
        gap: 30px;
    }

    .hero-image {
        max-width: 100%;
    }

    .hero-card {
        max-width: 100%;
    }
}


/* =========================
   MOBILE IMPROVEMENTS
========================= */

@media (max-width: 768px) {

    /* Better header layout */
    .header {
        gap: 10px;
    }

    /* Make filters easier on small screens */
    .filters {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .filter-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* Hero buttons */
    .hero-buttons {
        width: 100%;
    }

    .hero-buttons .btn {
        text-align: center;
    }

    /* Modal better on mobile */
    .modal {
        padding: 12px;
    }

    .modal-content {
        width: 100%;
        max-height: 88vh;
    }
}


/* =========================
   SMALL PHONE
========================= */

@media (max-width: 500px) {

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .hero-card {
        width: 100%;
        max-width: 280px;
    }

    .dashboard-list {
        padding: 18px;
    }

    .event-card {
        padding: 20px;
    }

    .dark-btn {
        flex-shrink: 0;
    }
}