/* Style.css - Premium Design System for Digix RCS */

:root {
    --bg-color: #080c14;
    --card-bg: rgba(17, 24, 39, 0.55);
    --card-hover-bg: rgba(24, 32, 53, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: #6366f1;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #a855f7;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.12) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(59, 130, 246, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    padding: 2rem 1rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

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

/* Glassmorphism Card Style */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    margin-bottom: 2rem;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.card:hover {
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.08);
}

/* Header Styles */
.header-area {
    text-align: center;
    margin-bottom: 3rem;
}

.header-area h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a5b4fc 10%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.header-area p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Section Dividers */
.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 0.9rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #e5e7eb;
}

.form-group label span.required {
    color: var(--error);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    background-color: rgba(10, 15, 30, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-speed) ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background-color: rgba(10, 15, 30, 0.95);
}

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* Text Help & Counters */
.field-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.counter {
    font-weight: 600;
}

.counter.limit-reached {
    color: var(--error);
}

/* File Upload Premium Style */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    background: rgba(10, 15, 30, 0.4);
    transition: all var(--transition-speed) ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.file-upload-wrapper:hover, .file-upload-wrapper.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    transition: color var(--transition-speed) ease;
}

.file-upload-wrapper:hover .file-upload-icon {
    color: var(--primary);
}

.file-upload-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.file-upload-text strong {
    color: var(--primary);
}

.file-upload-details {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.preview-thumbnail {
    margin-top: 0.75rem;
    max-width: 100%;
    max-height: 80px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: none;
}

.file-selected-name {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 500;
    display: none;
}

/* Alert Banners */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.75rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: none;
    color: #fff;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-edit {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-submit-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Login Card (Centered) */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    width: 100%;
    max-width: 450px;
    padding: 3rem 2.5rem;
}

/* Dashboard Styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.9rem;
}

.user-badge .avatar-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
}

/* Responsive Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
    background: rgba(10, 15, 30, 0.4);
}

.custom-table th {
    background: rgba(17, 24, 39, 0.8);
    color: #fff;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.custom-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: #e5e7eb;
    vertical-align: middle;
}

.custom-table tbody tr {
    transition: background-color var(--transition-speed) ease;
}

.custom-table tbody tr:hover {
    background-color: var(--card-hover-bg);
}

/* Thumbnail sizes on Table */
.table-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: #111827;
}

.doc-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.doc-link:hover {
    text-decoration: underline;
    color: var(--secondary);
}

.no-doc {
    color: var(--text-muted);
    font-style: italic;
}

/* Pagination Control Styling */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.pagination-list {
    display: flex;
    list-style: none;
    gap: 0.35rem;
}

.pagination-item a, .pagination-item span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-speed) ease;
    background: rgba(255, 255, 255, 0.03);
}

.pagination-item.active span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.pagination-item a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pagination-item.disabled span {
    color: var(--text-muted);
    cursor: not-allowed;
    background: transparent;
    opacity: 0.5;
}

/* Action controls */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Upload Previews in Edit page */
.existing-file-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.existing-file-preview img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.existing-file-info {
    font-size: 0.85rem;
    flex-grow: 1;
}

.existing-file-info a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
