/* Phi Mu Dayton Directory - Custom Styling */

/* ============ CSS Variables ============ */
:root {
    --primary: #D4768A;
    --primary-dark: #B85A6E;
    --secondary: #C9A64A;
    --background: #FFFFFF;
    --text: #333333;
    --light-accent: #F8E8EB;
    --border: #E5E5E5;
    --success: #4CAF50;
    --error: #E53935;
    --warning: #FF9800;
    --info: #2196F3;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --radius-sm: 4px;
}

/* ============ Reset & Base ============ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    color: var(--text);
    background-color: #F5F5F5;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

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

/* ============ Navbar ============ */
.navbar {
    background: var(--background);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.nav-brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.brand-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.brand-subtext {
    font-size: 0.75rem;
    color: var(--text);
    opacity: 0.7;
}

.nav-logo {
    height: 40px;
    width: auto;
}

.logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    flex: 1;
    justify-content: center;
}

.nav-link {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background: var(--light-accent);
}

.nav-admin {
    color: var(--secondary);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-weight: 500;
    color: var(--text);
}

.nav-link-small {
    font-size: 0.875rem;
    color: var(--text);
    opacity: 0.7;
}

.nav-link-small:hover {
    opacity: 1;
    color: var(--primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-mobile-only {
    display: none;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: all 0.3s ease;
}

/* ============ Main Content ============ */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* ============ Messages ============ */
.messages {
    margin-bottom: 1.5rem;
}

.message {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.message-error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

.message-warning {
    background: #FFF3E0;
    color: #E65100;
    border: 1px solid #FFCC80;
}

.message-info {
    background: #E3F2FD;
    color: #1565C0;
    border: 1px solid #90CAF9;
}

.message-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 0.5rem;
}

.message-close:hover {
    opacity: 1;
}

/* ============ Forms ============ */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 118, 138, 0.1);
}

.form-input[readonly] {
    background: #F5F5F5;
    cursor: not-allowed;
}

.form-help {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

.form-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-select-multiple {
    min-height: 150px;
}

/* ============ Buttons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

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

.btn-secondary:hover {
    background: #B8953D;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

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

.btn-danger:hover {
    background: #C62828;
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

button.btn:not([disabled]),
button[type="submit"].btn {
    cursor: pointer;
    pointer-events: auto;
    opacity: 1;
}

.btn-block {
    width: 100%;
}

/* ============ Cards ============ */
.card {
    background: var(--background);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--light-accent);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: #F9F9F9;
}

/* ============ Page Header ============ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    color: var(--text);
}

/* ============ Footer ============ */
.footer {
    background: var(--background);
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    color: #666;
    font-size: 0.875rem;
}

/* ============ Login Page ============ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--light-accent) 0%, #FFFFFF 100%);
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--background);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 120px;
    height: auto;
    margin-bottom: 1rem;
}

.login-title {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: #666;
    font-size: 0.875rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.login-footer a {
    font-size: 0.875rem;
}

/* ============ Directory Grid ============ */
.directory-container {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 2rem;
}

.alphabet-nav {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.alphabet-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.alphabet-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: var(--text);
    transition: all 0.2s ease;
}

.alphabet-link:hover,
.alphabet-link.active {
    background: var(--primary);
    color: white;
}

.alphabet-link.disabled {
    color: #CCC;
    pointer-events: none;
}

.directory-main {
    min-width: 0;
}

.search-container {
    margin-bottom: 1.5rem;
}

.search-input {
    padding-left: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
}

.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.member-card {
    background: var(--background);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.member-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--light-accent);
}

.member-photo-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: var(--light-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.member-info {
    padding: 1rem;
    text-align: center;
}

.member-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

/* ============ Member Detail Modal ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--background);
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.member-detail {
    position: relative;
}

.member-detail-photo {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.member-detail-info {
    padding: 1.5rem;
}

.member-detail-name {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.member-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.member-detail-icon {
    width: 20px;
    color: var(--secondary);
    flex-shrink: 0;
}

.member-detail-label {
    font-weight: 600;
    min-width: 80px;
}

/* ============ Photo Gallery ============ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.gallery-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
}

.gallery-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
}

.gallery-date {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* ============ Lightbox ============ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -2rem;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

.lightbox-info {
    color: white;
    padding: 1rem 0;
    text-align: center;
}

/* ============ Calendar ============ */
.calendar-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.calendar-nav {
    display: flex;
    gap: 0.5rem;
}

.calendar-nav-btn {
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: var(--light-accent);
    border-color: var(--primary);
}

.calendar-grid {
    background: var(--background);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--light-accent);
}

.calendar-weekday {
    padding: 0.75rem;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    min-height: 80px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-width: 0 1px 1px 0;
}

.calendar-day:nth-child(7n) {
    border-right-width: 0;
}

.calendar-day-number {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.calendar-day.today .calendar-day-number {
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day.empty {
    background: #F9F9F9;
}

.calendar-event {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--light-accent);
    color: var(--primary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar-event:hover {
    background: var(--primary);
    color: white;
}

.upcoming-events {
    background: var(--background);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.upcoming-events h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.upcoming-event-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.upcoming-event-item:last-child {
    border-bottom: none;
}

.upcoming-event-date {
    font-size: 0.75rem;
    color: var(--secondary);
    font-weight: 600;
}

.upcoming-event-title {
    font-weight: 500;
}

/* ============ Admin Dashboard ============ */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--background);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: center;
}

.stat-card-link {
    display: block;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.stat-card-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.stat-card-link .stat-number,
.stat-card-link .stat-label {
    color: inherit;
}

.stat-number {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: #666;
    font-size: 0.875rem;
}

.admin-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* ============ Tables ============ */
.table-container {
    background: var(--background);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--light-accent);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.table tr:hover {
    background: #F9F9F9;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============ Badge ============ */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
}

.badge-success {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-warning {
    background: #FFF3E0;
    color: #E65100;
}

.badge-danger {
    background: #FFEBEE;
    color: #C62828;
}

.badge-info {
    background: #E3F2FD;
    color: #1565C0;
}

/* ============ View Toggle ============ */
.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--light-accent);
    border-radius: var(--radius);
    padding: 0.25rem;
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text);
    opacity: 0.5;
    transition: all 0.2s ease;
}

.view-btn:hover {
    opacity: 0.8;
}

.view-btn.active {
    background: var(--background);
    box-shadow: var(--shadow);
    opacity: 1;
    color: var(--primary);
}

/* ============ Member List View ============ */
.member-list {
    background: var(--background);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.member-list .table tr {
    cursor: pointer;
}

.member-list .table tr:hover {
    background: var(--light-accent);
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        padding-top: 1rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links.active .nav-mobile-only {
        display: block;
    }

    .nav-user {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .directory-container {
        grid-template-columns: 1fr;
    }

    .alphabet-nav {
        position: static;
    }

    .alphabet-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .calendar-container {
        grid-template-columns: 1fr;
    }

    .calendar-day {
        min-height: 60px;
    }

    .member-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .member-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}
