/* -------------------------
   GLOBAL
------------------------- */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

a {
    color: #4f46e5;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}


/* -------------------------
   PAGE CONTAINER
------------------------- */

.container {
    width: 90%;
    max-width: 1100px;
    margin: 40px auto;
}


/* -------------------------
   HEADINGS
------------------------- */

h1 {
    color: #1e1b4b;
    margin-bottom: 10px;
}

h2 {
    color: #312e81;
}

h3 {
    color: #3730a3;
}


/* -------------------------
   CARDS
------------------------- */

.card {
    background: white;
    padding: 25px;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}


/* -------------------------
   FORMS
------------------------- */

label {
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    max-width: 500px;
    padding: 11px 12px;
    margin-top: 6px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #4f46e5;
}


/* Don't stretch checkboxes */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin-right: 6px;
}


/* -------------------------
   BUTTONS
------------------------- */

button,
.button {
    display: inline-block;
    background: #4f46e5;
    color: white;
    border: none;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
}

button:hover,
.button:hover {
    background: #4338ca;
    text-decoration: none;
}


/* -------------------------
   FLASH MESSAGES
------------------------- */

.flash-message {
    max-width: 700px;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
}

.flash-message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.flash-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}


/* -------------------------
   NAVIGATION
------------------------- */

.navbar {
    background: white;
    padding: 16px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.nav-brand {
    font-size: 20px;
    font-weight: bold;
    color: #312e81;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}


/* -------------------------
   DASHBOARD GRID
------------------------- */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(230px, 1fr)
    );
    gap: 20px;
    margin-top: 30px;
}

.dashboard-card {
    background: white;
    padding: 24px;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.07);
}


/* -------------------------
   BADGES
------------------------- */

.badge {
    display: inline-block;
    background: #dc2626;
    color: white;
    min-width: 22px;
    padding: 3px 7px;
    border-radius: 20px;
    text-align: center;
    font-size: 12px;
}


/* -------------------------
   MOBILE
------------------------- */

@media (max-width: 700px) {

    .container {
        width: 92%;
        margin: 25px auto;
    }

    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 12px;
    }

    input,
    select,
    textarea {
        max-width: 100%;
    }

    .card {
        padding: 18px;
    }
}

/* -------------------------
   AUTHENTICATION PAGES
------------------------- */

.auth-card {
    max-width: 520px;
    margin: 60px auto;
}

/* -------------------------
   HOME PAGE
------------------------- */

.home-card {
    max-width: 850px;
    margin: 100px auto;
    padding: 60px;
    text-align: center;
}

.home-card h1 {
    font-size: 42px;
    margin-top: 0;
}

.home-description {
    max-width: 650px;
    margin: 20px auto 30px;
    font-size: 18px;
    line-height: 1.6;
    color: #4b5563;
}

.home-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.secondary-button {
    display: inline-block;
    padding: 11px 18px;
    border: 1px solid #4f46e5;
    border-radius: 8px;
    color: #4f46e5;
    background: white;
    text-decoration: none;
}

.secondary-button:hover {
    background: #eef2ff;
    text-decoration: none;
}


/* -------------------------
   STUDY PROFILE
------------------------- */

.matches-header {
    text-align: center;
    margin-bottom: 30px;
}

.profile-header h1 {
    margin-bottom: 8px;
}

.profile-header p {
    color: #6b7280;
    font-size: 16px;
    margin-top: 0;
}

.profile-card {
    max-width: 750px;
}

.profile-card form {
    margin-top: 10px;
}

.profile-card label {
    display: inline-block;
    margin-bottom: 4px;
}

.profile-card small {
    color: #6b7280;
}

.profile-card input[type="checkbox"] {
    margin-top: 10px;
}

/* -------------------------
   STUDY PARTNER MATCHES
------------------------- */

.matches-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(320px, 1fr)
    );
    gap: 22px;
}

.match-card {
    margin-bottom: 0;
}

.match-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.match-card-header h2 {
    margin: 0 0 5px;
}

.match-course {
    margin: 0;
    color: #6b7280;
    font-weight: 600;
}

.match-score {
    background: #eef2ff;
    color: #4338ca;
    padding: 12px 15px;
    border-radius: 12px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    min-width: 85px;
}

.match-score span {
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.match-details {
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
    margin-bottom: 20px;
}

.match-details p {
    margin: 10px 0;
}

.empty-state {
    max-width: 650px;
    margin: 0 auto;
    text-align: center;
    padding: 45px;
}

.empty-state p {
    color: #6b7280;
}


/* Mobile */

@media (max-width: 700px) {

    .matches-grid {
        grid-template-columns: 1fr;
    }

    .match-card-header {
        flex-direction: column;
    }
}

/* -------------------------
   STUDY REQUESTS
------------------------- */

.requests-header {
    text-align: center;
    margin-bottom: 30px;
}

.requests-header h1 {
    margin-bottom: 8px;
}

.requests-header p {
    color: #6b7280;
    margin-top: 0;
}

.requests-list {
    max-width: 750px;
    margin: 0 auto;
}

.request-card {
    margin-bottom: 20px;
}

.request-card h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.request-card p {
    color: #4b5563;
    line-height: 1.5;
}

.request-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.request-actions form {
    margin: 0;
}

.decline-button {
    background: white;
    color: #dc2626;
    border: 1px solid #dc2626;
}

.decline-button:hover {
    background: #fef2f2;
}

/* -------------------------
   MY STUDY PARTNERS
------------------------- */

.partners-header {
    text-align: center;
    margin-bottom: 30px;
}

.partners-header h1 {
    margin-bottom: 8px;
}

.partners-header p {
    margin-top: 0;
    color: #6b7280;
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(320px, 1fr)
    );
    gap: 22px;
}

.partner-card {
    margin-bottom: 0;
}

.partner-card h2 {
    margin-top: 0;
    margin-bottom: 5px;
}

.partner-course {
    color: #4f46e5;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 20px;
}

.partner-details {
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
    margin-bottom: 20px;
}

.partner-details p {
    margin: 10px 0;
    line-height: 1.4;
}


/* Mobile */

@media (max-width: 700px) {

    .partners-grid {
        grid-template-columns: 1fr;
    }
}

/* -------------------------
   MESSAGES
------------------------- */

.messages-header {
    text-align: center;
    margin-bottom: 30px;
}

.messages-header h1 {
    margin-bottom: 8px;
}

.messages-header p {
    margin-top: 0;
    color: #6b7280;
}

.conversation-list {
    max-width: 750px;
    margin: 0 auto;
}

.conversation-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.conversation-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.conversation-info h2 {
    margin: 0 0 5px;
}

.conversation-info p {
    margin: 0;
    color: #6b7280;
}

.conversation-avatar {
    width: 52px;
    height: 52px;
    min-width: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #eef2ff;
    color: #4338ca;

    font-size: 16px;
    font-weight: bold;
}


/* Mobile */

@media (max-width: 700px) {

    .conversation-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* -------------------------
   CHAT
------------------------- */

.chat-container {
    max-width: 850px;
    margin: 0 auto;
    background: white;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}


/* Chat Header */

.chat-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e5e7eb;
}

.chat-header h1 {
    margin: 12px 0 3px;
    font-size: 22px;
}

.chat-header p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.chat-back {
    font-size: 14px;
}


/* Message Area */

.chat-messages {
    min-height: 400px;
    max-height: 550px;
    overflow-y: auto;
    padding: 25px;

    background: #f9fafb;
}


/* Each Message Row */

.message-row {
    display: flex;
    margin-bottom: 18px;
}

.message-row.sent {
    justify-content: flex-end;
}

.message-row.received {
    justify-content: flex-start;
}


/* Message + Timestamp */

.message-content {
    max-width: 70%;
}

.message-row.sent .message-content {
    text-align: right;
}

.message-row.received .message-content {
    text-align: left;
}


/* Message Bubbles */

.message-bubble {
    display: inline-block;
    padding: 11px 15px;
    border-radius: 16px;
    line-height: 1.4;
    word-break: break-word;
}

.sent-bubble {
    background: #4f46e5;
    color: white;

    border-bottom-right-radius: 4px;
}

.received-bubble {
    background: white;
    color: #1f2937;

    border: 1px solid #e5e7eb;

    border-bottom-left-radius: 4px;
}


/* Timestamp */

.message-time {
    display: block;
    margin-top: 5px;

    color: #9ca3af;
    font-size: 11px;
}


/* No Messages */

.chat-empty {
    text-align: center;
    color: #6b7280;
    padding-top: 120px;
}


/* Message Input */

.chat-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;

    padding: 18px 20px;

    border-top: 1px solid #e5e7eb;
    background: white;
}

.chat-form textarea {
    flex: 1;
    max-width: none;

    min-height: 44px;
    max-height: 120px;

    resize: vertical;

    margin: 0;
}

.chat-form button {
    height: 44px;
}


/* Mobile */

@media (max-width: 700px) {

    .chat-container {
        border-radius: 10px;
    }

    .chat-messages {
        min-height: 350px;
        padding: 18px;
    }

    .message-content {
        max-width: 85%;
    }

    .chat-form {
        padding: 12px;
    }
}

/* -------------------------
   NOTIFICATIONS
------------------------- */

.notifications-header {
    text-align: center;
    margin-bottom: 30px;
}

.notifications-header h1 {
    margin-bottom: 8px;
}

.notifications-header p {
    margin-top: 0;
    color: #6b7280;
}

.notifications-list {
    max-width: 750px;
    margin: 0 auto;
}

.notification-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;

    padding: 20px;
    margin-bottom: 14px;
}

.notification-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;

    margin-top: 7px;

    background: #4f46e5;
    border-radius: 50%;
}

.notification-content {
    flex: 1;
}

.notification-content p {
    margin: 0 0 7px;
    line-height: 1.5;
}

.notification-time {
    color: #9ca3af;
    font-size: 12px;
}

/* -------------------------
   ACCOUNT SETTINGS
------------------------- */

.settings-header {
    text-align: center;
    margin-bottom: 30px;
}

.settings-header h1 {
    margin-bottom: 8px;
}

.settings-header p {
    margin-top: 0;
    color: #6b7280;
}

.settings-container {
    max-width: 750px;
    margin: 0 auto;
}

.settings-messages {
    max-width: 750px;
    margin: 0 auto 20px;
}

.settings-card {
    margin-bottom: 25px;
}

.settings-card h2 {
    margin-top: 0;
    margin-bottom: 8px;
}

.settings-description {
    color: #6b7280;
    margin-top: 0;
    margin-bottom: 25px;
}

.settings-card form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.settings-card form label {
    margin-top: 18px;
}

.settings-card form label:first-of-type {
    margin-top: 0;
}

.settings-card input {
    margin-bottom: 5px;
}

.settings-card small {
    color: #6b7280;
    margin-top: 3px;
}

.settings-button {
    margin-top: 22px;
}


/* DELETE ACCOUNT */

.danger-card {
    border: 1px solid #fecaca;
}

.danger-card h2 {
    color: #b91c1c;
}

.delete-confirmation {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
    font-weight: normal;
}

.delete-confirmation input {
    margin-top: 3px;
}

.delete-button {
    background: #dc2626;
}

.delete-button:hover {
    background: #b91c1c;
}

/* -------------------------
   AUTH FOOTER
------------------------- */

.auth-footer {
    margin-top: 25px;
    color: #6b7280;
}
.check-email-card {
    text-align: center;
}

.check-email-card p {
    color: #6b7280;
    line-height: 1.6;
}

.email-icon {
    width: 65px;
    height: 65px;
    margin: 0 auto 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #eef2ff;
    color: #4f46e5;
    border-radius: 50%;

    font-size: 30px;
}