/**
 * styles.css
 * Styling for File Management System
 * Clean, minimal, and modern design
 */

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
    --beige: #f5f5dc;
    --beige-dark: #d4d4b0;
    --border-color: #d4d4b0;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --background: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

/* ===== Login Page Styles ===== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: var(--background);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-size: 28px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 14px;
}

.login-form {
    margin-bottom: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.warning-text {
    font-size: 12px;
    color: var(--warning-color);
}

/* ===== Admin Dashboard Styles ===== */
.admin-container {
    min-height: 100vh;
    background-color: #f8f9fa;
}

.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 40px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

#current-category-display {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.admin-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    min-height: calc(100vh - 80px);
}

/* ===== Category Menu ===== */
.category-menu {
    background: var(--background);
    padding: 30px 20px;
    border-right: 2px solid var(--border-color);
}

.category-menu h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 8px;
}

.category-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--beige);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    color: var(--text-dark);
    font-weight: 500;
}

.category-btn:hover {
    background: var(--beige-dark);
    transform: translateX(5px);
}

.category-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    transform: translateX(5px);
}

/* ===== Main Content Area ===== */
.main-content {
    padding: 30px 40px;
    overflow-y: auto;
}

.upload-section,
.files-section {
    background: var(--background);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    border: 2px solid var(--border-color);
}

.upload-section h2,
.files-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* ===== Form Styles ===== */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.form-group input[type="file"] {
    padding: 10px;
    background: var(--beige);
    cursor: pointer;
}

/* ===== Button Styles ===== */
.btn-primary {
    background: var(--secondary-color);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
}

.btn-delete {
    background: var(--error-color);
    color: white;
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-delete:hover {
    background: #c0392b;
    transform: scale(1.05);
}

/* ===== Messages ===== */
#upload-messages {
    margin-bottom: 20px;
}

.message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===== Files List (Admin) ===== */
#files-list {
    min-height: 100px;
}

.files-list-ul {
    list-style: none;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--beige);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s;
}

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

.file-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.file-name {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.file-name:hover {
    text-decoration: underline;
}

.file-date {
    font-size: 12px;
    color: var(--text-light);
}

/* ===== Placeholder States ===== */
.placeholder-text,
.loading,
.error-text {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-style: italic;
}

.error-text {
    color: var(--error-color);
}

/* ===== Public Documents Display ===== */
.documents-container {
    background: var(--beige);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    min-height: fit-content;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Ensure pricing item boxes align at the top */
.pricing-item-box {
    align-items: flex-start !important;
    justify-content: flex-start !important;
}

.pricing-item-box .documents-container {
    width: 100%;
    height: auto;
}

.documents-container h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 22px;
}

.documents-list {
    list-style: none;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s;
}

.document-item-hidden {
    display: none !important;
}

.document-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.document-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.document-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-grow: 1;
}

.document-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

.document-link:hover {
    text-decoration: underline;
}

.document-date {
    font-size: 12px;
    color: var(--text-light);
}

.no-documents {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-style: italic;
}

/* ===== Document Expand/Collapse ===== */
.documents-expand-wrapper {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.documents-expand-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.documents-expand-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.expand-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 14px;
    line-height: 1;
    margin-left: 5px;
}

.documents-expand-btn.expanded .expand-icon {
    transform: rotate(180deg);
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .admin-content {
        grid-template-columns: 1fr;
    }
    
    .category-menu {
        border-right: none;
        border-bottom: 2px solid var(--border-color);
    }
    
    .category-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    #current-category-display,
    .logout-btn {
        width: 100%;
        text-align: center;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .upload-section,
    .files-section {
        padding: 20px;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .btn-delete {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .category-list {
        grid-template-columns: 1fr;
    }
    
    .login-box {
        padding: 30px 20px;
    }
}

