/* ============================================
   Apexcode+ Admin Dashboard Styles
   ============================================ */

/* CSS Variables */
:root {
    --primary-color: #00d4ff;
    --secondary-color: #7b2cbf;
    --danger-color: #ff4757;
    --success-color: #2ed573;
    --warning-color: #ffa502;
    --dark-bg: #0a0a0f;
    --sidebar-bg: #12121a;
    --card-bg: #1a1a24;
    --text-light: #f0f0f0;
    --text-muted: #a0a0a0;
    --border-color: rgba(255, 255, 255, 0.1);
    --gradient: linear-gradient(135deg, #00d4ff 0%, #7b2cbf 100%);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
}

/* ============================================
   Login Page Styles
   ============================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(123, 44, 191, 0.1) 0%, transparent 50%),
        var(--dark-bg);
}

.login-box {
    background: var(--sidebar-bg);
    padding: 3rem;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    position: relative;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-header h1 span {
    color: var(--primary-color);
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-light);
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 45px;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 1rem;
    transition: var(--transition);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.remember-me label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-muted);
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: var(--gradient);
    color: var(--dark-bg);
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.login-footer a {
    color: var(--text-muted);
    transition: var(--transition);
}

.login-footer a:hover {
    color: var(--primary-color);
}

.login-alert {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    background: var(--danger-color);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--transition);
}

.login-alert.show {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Dashboard Layout
   ============================================ */

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    padding: 20px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.5rem;
}

.sidebar-header h2 span {
    color: var(--primary-color);
}

.admin-badge {
    background: var(--gradient);
    color: var(--dark-bg);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 10px;
    color: var(--text-muted);
    transition: var(--transition);
    position: relative;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary-color);
}

.nav-item i {
    width: 20px;
    font-size: 1.1rem;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--danger-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.nav-item.logout {
    margin-top: auto;
    color: var(--danger-color);
}

.nav-item.logout:hover {
    background: rgba(255, 71, 87, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    background: var(--dark-bg);
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.header-title h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.header-title p {
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    padding: 10px 10px 10px 40px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-light);
    width: 250px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    color: var(--text-muted);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--dark-bg);
}

/* Dashboard Sections */
.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-light);
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-icon:hover {
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-icon.btn-danger:hover {
    background: rgba(255, 71, 87, 0.1);
    color: var(--danger-color);
    border-color: var(--danger-color);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-tab {
    padding: 10px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.filter-tab:hover,
.filter-tab.active {
    background: var(--gradient);
    color: var(--dark-bg);
    border-color: transparent;
}

/* Messages Container */
.messages-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.message-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient);
    opacity: 0;
    transition: var(--transition);
}

.message-card:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.message-card:hover::before {
    opacity: 1;
}

.message-card.unread {
    background: rgba(0, 212, 255, 0.05);
}

.message-card.unread::before {
    opacity: 1;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.message-sender {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sender-avatar {
    width: 45px;
    height: 45px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--dark-bg);
    font-weight: 600;
    font-size: 1.1rem;
}

.sender-info h4 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.sender-info span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.message-subject {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-light);
}

.message-preview {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.message-time {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.unread-badge {
    background: var(--primary-color);
    color: var(--dark-bg);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--text-light);
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.analytics-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.analytics-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.analytics-icon {
    width: 60px;
    height: 60px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.analytics-icon.unread {
    background: rgba(255, 165, 2, 0.1);
    color: var(--warning-color);
}

.analytics-icon.success {
    background: rgba(46, 213, 115, 0.1);
    color: var(--success-color);
}

.analytics-info {
    display: flex;
    flex-direction: column;
}

.analytics-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-light);
}

.analytics-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Settings */
.settings-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
}

.settings-card h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.settings-card .form-group {
    margin-bottom: 15px;
}

.settings-card label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.settings-card input {
    width: 100%;
    padding: 12px 15px;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-light);
    transition: var(--transition);
}

.settings-card input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    padding: 12px 25px;
    background: var(--gradient);
    color: var(--dark-bg);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--sidebar-bg);
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.3rem;
}

.modal-close {
    width: 35px;
    height: 35px;
    background: var(--card-bg);
    border: none;
    border-radius: 50%;
    color: var(--text-light);
    font-size: 1.5rem;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-color);
}

.modal-body {
    padding: 25px;
    max-height: 50vh;
    overflow-y: auto;
}

.message-detail .detail-row {
    display: flex;
    margin-bottom: 15px;
    gap: 15px;
}

.message-detail .detail-row label {
    min-width: 80px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-detail .detail-row label i {
    color: var(--primary-color);
}

.message-detail .message-content {
    flex-direction: column;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.message-content p {
    margin-top: 10px;
    line-height: 1.7;
    color: var(--text-light);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
}

.btn-reply,
.btn-delete {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-reply {
    background: var(--gradient);
    color: var(--dark-bg);
}

.btn-reply:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}

.btn-delete {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.btn-delete:hover {
    background: var(--danger-color);
    color: white;
}

/* Portfolio Section Styles */
.portfolio-form-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.work-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.work-form .form-group {
    margin-bottom: 0;
}

.work-form select {
    width: 100%;
    padding: 12px 15px;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-light);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.work-form select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.works-container {
    margin-top: 30px;
}

.works-container h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
}

.works-container h3 i {
    color: var(--primary-color);
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.work-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    transition: var(--transition);
    position: relative;
}

.work-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.work-preview {
    width: 100%;
    height: 140px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    background: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.work-preview img,
.work-preview iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work-info h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-light);
}

.work-type {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary-color);
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.work-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.share-link {
    background: rgba(46, 213, 115, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: monospace;
    word-break: break-all;
    margin-bottom: 15px;
    text-align: center;
}

.work-actions {
    display: flex;
    gap: 10px;
}

.work-actions .btn-icon {
    flex: 1;
    padding: 8px;
}

#portfolioEmptyState {
    grid-column: 1 / -1;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 15px 10px;
    }
    
    .sidebar-header h2,
    .admin-badge,
    .nav-item span,
    .nav-item .badge {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    
    .nav-item i {
        margin: 0;
    }
    
    .main-content {
        margin-left: 80px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .filter-tabs {
        flex-wrap: wrap;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Upload Section Styles
   ============================================ */

.upload-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.upload-area {
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    transition: var(--transition);
    position: relative;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(0, 212, 255, 0.05);
}

.upload-area i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.upload-area h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.upload-area p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.upload-area input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-area .btn-primary {
    display: inline-block;
    cursor: pointer;
    pointer-events: none;
}

.upload-hint {
    font-size: 0.85rem !important;
    color: var(--text-muted) !important;
}

/* Upload Progress */
.upload-progress-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
}

.upload-progress {
    height: 8px;
    background: var(--dark-bg);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: var(--gradient);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Uploaded Files */
.uploaded-files h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.uploaded-files h3 i {
    color: var(--primary-color);
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.file-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    position: relative;
}

.file-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.file-preview {
    width: 100%;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    background: var(--dark-bg);
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.file-info h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-info span {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.file-date {
    margin-top: 5px !important;
}

.file-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.file-actions .btn-icon {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
}

/* Empty State for Upload */
#uploadEmptyState {
    grid-column: 1 / -1;
}
