/* Admin Panel Styles */

/* Login Container */
.admin-login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--background);
    padding: 1rem;
}

.admin-login-card {
    width: 100%;
    max-width: 28rem;
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    border: 1px solid var(--border);
}

.admin-logo {
    text-align: center;
    margin-bottom: 1rem;
}

.admin-logo .logo-box {
    margin: 0 auto 1rem;
}

.admin-title {
    font-size: 1.875rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--foreground);
}

.admin-subtitle {
    text-align: center;
    color: var(--muted-foreground);
    margin-bottom: 2rem;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-credentials {
    background-color: var(--muted);
    border-radius: 0.5rem;
    padding: 1rem;
    font-size: 0.75rem;
    text-align: center;
}

.credentials-title {
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.credentials-text {
    font-family: 'Courier New', monospace;
    background-color: var(--background);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    color: var(--primary);
    font-weight: 600;
}

.btn-logout {
    background-color: var(--destructive);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-logout:hover {
    opacity: 0.9;
}

/* Admin Header */
.admin-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-header-content {
    max-width: 80rem;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-brand .logo-box {
    width: 2.5rem;
    height: 2.5rem;
}

.admin-header-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--foreground);
}

.admin-user-info {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin: 0;
}

/* Admin Container */
.admin-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Admin Stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.stat-description {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-top: 0.5rem;
}

/* Admin Tabs */
.admin-tabs {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border);
    background-color: var(--background);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--foreground);
    font-size: 1rem;
}

.tab-btn.active {
    background-color: var(--primary);
    color: white;
}

.tab-btn:hover:not(.active) {
    background-color: var(--muted);
}

.tab-content {
    padding: 2rem;
}

/* Upload Section */
.upload-section {
    background-color: var(--muted);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.upload-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--foreground);
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* File Input */
.file-input-wrapper {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-input-wrapper:hover {
    border-color: var(--primary);
}

.file-input {
    display: none;
}

.file-input-label {
    cursor: pointer;
    display: block;
}

.file-input-label p {
    margin: 0;
    color: var(--foreground);
    font-weight: 500;
}

.file-input-subtitle {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-top: 0.5rem !important;
}

/* Resources List Section */
.resources-list-section {
    margin-top: 2rem;
}

.resources-list-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--foreground);
}

.resources-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.resource-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.resource-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.resource-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.resource-item-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--foreground);
}

.resource-item-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 0.75rem;
}

.resource-item-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.resource-item-tag {
    padding: 0.25rem 0.75rem;
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.resource-item-meta {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-bottom: 0.75rem;
}

.resource-item-actions {
    display: flex;
    gap: 0.5rem;
}

.resource-item-actions .btn {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.btn-delete {
    background-color: var(--destructive);
    color: white;
}

.btn-delete:hover {
    opacity: 0.9;
}

.resources-empty {
    background-color: var(--muted);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    color: var(--muted-foreground);
}

/* Messages Section */
.message-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: none;
    background-color: var(--muted);
    color: var(--foreground);
    cursor: pointer;
}

.filter-btn.active {
    background-color: var(--primary);
    color: white;
}

.filter-btn:hover:not(.active) {
    background-color: var(--border);
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-item {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.message-item.unread {
    background-color: #EFF6FF;
    border-color: #BFDBFE;
}

.message-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.message-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--foreground);
}

.message-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid;
}

.type-client {
    background-color: #EFF6FF;
    color: #1E40AF;
    border-color: #BFDBFE;
}

.type-student {
    background-color: #ECFDF5;
    color: #065F46;
    border-color: #A7F3D0;
}

.type-other {
    background-color: #FFFBEB;
    color: #92400E;
    border-color: #FCD34D;
}

.message-new-badge {
    background-color: var(--destructive);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.message-email {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.message-time {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    text-align: right;
}

.message-content {
    background-color: var(--background);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    border: 1px solid var(--border);
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.message-actions .btn {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.messages-empty {
    background-color: var(--muted);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    color: var(--muted-foreground);
}

/* Hamburger Menu (Admin) */
#admin-hamburger-menu {
    display: none;
    flex-direction: column;
    gap: 0.35rem;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 100;
}

#admin-hamburger-menu span {
    display: block;
    width: 1.5rem;
    height: 0.2rem;
    background-color: var(--foreground);
    border-radius: 0.1rem;
    transition: all 0.3s ease;
}

#admin-hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(0.5rem, 0.6rem);
}

#admin-hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

#admin-hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(0.5rem, -0.6rem);
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .message-filters {
        flex-direction: column;
    }

    .filter-btn {
        width: 100%;
    }

    .message-header {
        flex-direction: column;
    }

    .admin-header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .tabs-header {
        flex-direction: column;
    }

    .tab-btn {
        padding: 0.75rem;
        font-size: 0.875rem;
    }

    .tab-content {
        padding: 1rem;
    }
}

@media (max-width: 550px) {
    #admin-hamburger-menu {
        display: flex;
    }

    .admin-header-content {
        flex-direction: row;
        gap: 0.5rem;
    }

    .admin-brand {
        flex: 1;
    }

    .admin-header-title {
        font-size: 1rem;
    }

    .admin-user-info {
        display: none;
    }

    #logout-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
}
