/* ===================================
   School Management System - Modules CSS
   Main stylesheet for Alumni, Files, and Chat modules
   =================================== */

/* ===================================
   GLOBAL STYLES
   =================================== */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #f9fafb;
}

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

/* ===================================
   COMMON COMPONENTS
   =================================== */

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.page-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
    font-weight: 700;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-primary:hover {
    background-color: #1d4ed8;
}

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

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

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

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

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

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1.1rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-primary {
    background-color: #dbeafe;
    color: var(--primary-color);
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #cffafe;
    color: #155e75;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 15px 0;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: white;
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control:disabled {
    background-color: #f1f5f9;
    cursor: not-allowed;
    opacity: 0.6;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

input[type="checkbox"].form-control,
input[type="radio"].form-control {
    width: auto;
    height: 1.2rem;
    margin-right: 0.5rem;
    cursor: pointer;
}

input[type="file"].form-control {
    padding: 8px;
}

input[type="date"].form-control,
input[type="time"].form-control,
input[type="datetime-local"].form-control {
    cursor: pointer;
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-error,
.errorlist {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 5px;
    list-style: none;
    padding: 0;
}

.form-error li,
.errorlist li {
    margin-bottom: 3px;
}

/* Filters */
.filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.form-inline .form-control {
    width: auto;
    flex: 1;
    min-width: 200px;
}

.form-inline label {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d1fae5;
    border-color: var(--success-color);
    color: #065f46;
}

.alert-danger,
.alert-error {
    background-color: #fee2e2;
    border-color: var(--danger-color);
    color: #991b1b;
}

.alert-warning {
    background-color: #fef3c7;
    border-color: var(--warning-color);
    color: #92400e;
}

.alert-info {
    background-color: #dbeafe;
    border-color: var(--info-color);
    color: #1e40af;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.alert li {
    margin-bottom: 5px;
}

.alert:last-child {
    margin-bottom: 0;
}

/* ===================================
   ALUMNI MODULE STYLES
   =================================== */

/* Alumni Grid */
.alumni-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.alumni-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.alumni-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.alumni-card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.alumni-card h3 a {
    color: var(--primary-color);
    text-decoration: none;
}

.alumni-card h3 a:hover {
    text-decoration: underline;
}

.alumni-card .graduation {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.alumni-card .occupation {
    font-weight: 500;
    margin-bottom: 5px;
}

.alumni-card .employer {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* Alumni Profile */
.alumni-profile {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.profile-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.profile-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.graduation-info {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.profile-body section {
    margin-bottom: 30px;
}

.profile-body h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
}

.quote {
    background: var(--light-bg);
    padding: 20px;
    border-left: 4px solid var(--primary-color);
    border-radius: 6px;
    font-style: italic;
}

/* Events */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.event-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.event-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.event-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.event-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.event-meta i {
    margin-right: 5px;
}

/* Stories */
.story-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.story-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.story-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.story-card h3 a:hover {
    color: var(--primary-color);
}

/* ===================================
   FILES MODULE STYLES
   =================================== */

/* Files List */
.files-list {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.file-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

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

.file-item:hover {
    background-color: var(--light-bg);
}

.file-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
    border-radius: 8px;
}

.file-icon .badge {
    font-size: 0.75rem;
    font-weight: 700;
}

.file-info {
    flex-grow: 1;
    min-width: 0;
}

.file-info h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.file-info h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.file-info h3 a:hover {
    color: var(--primary-color);
}

.file-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.file-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.file-meta span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.file-actions {
    flex-shrink: 0;
    display: flex;
    gap: 10px;
}

/* File Detail */
.file-detail {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.file-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.file-header-info h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.file-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.stat-box .label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.stat-box .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Comments */
.comments-section {
    margin-top: 40px;
}

.comments-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.comment {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.comment-body {
    color: var(--text-primary);
}

/* ===================================
   CHAT MODULE STYLES
   =================================== */

/* Chat List */
.chat-list {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

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

.chat-item:hover {
    background-color: var(--light-bg);
}

.chat-item.unread {
    background-color: #eff6ff;
}

.chat-avatar {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.avatar-group {
    background: var(--success-color);
}

.chat-info {
    flex-grow: 1;
    min-width: 0;
}

.chat-info h3 {
    font-size: 1rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.last-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.chat-info small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.unread-badge {
    flex-shrink: 0;
}

.unread-badge .badge {
    background-color: var(--primary-color);
    color: white;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Chat Room */
.chat-room {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    max-height: 800px;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid var(--border-color);
    background: white;
}

.chat-header h2 {
    font-size: 1.3rem;
    margin: 0;
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--light-bg);
}

.message {
    max-width: 70%;
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 12px;
    background: white;
    box-shadow: var(--shadow-sm);
}

.message.own-message {
    margin-left: auto;
    background: var(--primary-color);
    color: white;
}

.message-sender {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.85rem;
}

.message-sender strong {
    font-weight: 600;
}

.message-sender small {
    opacity: 0.7;
}

.message-content {
    word-wrap: break-word;
}

.chat-input {
    display: flex;
    gap: 10px;
    padding: 20px;
    background: white;
    border-top: 1px solid var(--border-color);
}

.chat-input .form-control {
    flex: 1;
    margin: 0;
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .form-inline {
        flex-direction: column;
    }

    .form-inline .form-control {
        width: 100%;
    }

    .alumni-grid,
    .event-grid {
        grid-template-columns: 1fr;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .message {
        max-width: 85%;
    }

    .chat-room {
        height: calc(100vh - 80px);
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.5rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .chat-header {
        flex-direction: column;
        gap: 10px;
    }

    .chat-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* ===================================
   UTILITY CLASSES
   =================================== */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.p-10 {
    padding: 10px;
}

.p-20 {
    padding: 20px;
}

.p-30 {
    padding: 30px;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

.w-full {
    width: 100%;
}

.hidden {
    display: none;
}
