/* =============================================
   AMFreelance - Component Styles
   ============================================= */

/* =============================================
   AUTH PAGES
   ============================================= */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    padding: 40px 20px;
}

.auth-container {
    width: 100%;
    max-width: 480px;
}

.auth-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 40px;
    border: 1px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo {
    justify-content: center;
    margin-bottom: 24px;
    font-size: 26px;
}

.auth-header h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.social-login-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 4px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.social-btn:hover {
    border-color: var(--gray-300);
    background: var(--bg-secondary);
}

.social-btn img {
    width: 20px;
    height: 20px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    font-weight: 600;
}

.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.role-option {
    position: relative;
    cursor: pointer;
}

.role-option input {
    position: absolute;
    opacity: 0;
}

.role-option-card {
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-fast);
}

.role-option input:checked + .role-option-card {
    border-color: var(--primary);
    background: var(--primary-50);
}

.role-option-card i {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 8px;
    display: block;
}

.role-option-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.role-option-card p {
    font-size: 12px;
    color: var(--text-muted);
}

/* =============================================
   DASHBOARD
   ============================================= */
.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - var(--header-height) - var(--topbar-height));
}

.dashboard-sidebar {
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: 24px 0;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.sidebar-menu {
    padding: 0 12px;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 16px 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.sidebar-link:hover {
    background: var(--primary-50);
    color: var(--primary);
}

.sidebar-link.active {
    background: var(--primary);
    color: white;
}

.sidebar-link i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.sidebar-link .count {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-main {
    padding: 32px;
    background: var(--bg-secondary);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-size: 28px;
    font-weight: 700;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.dashboard-stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
}

.dashboard-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.dashboard-stat-info h4 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.dashboard-stat-info .stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.dashboard-stat-info .stat-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

.dashboard-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.dashboard-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.dashboard-card-body {
    padding: 24px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--bg-secondary);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.status-active, .status-completed { background: var(--success-light); color: #065f46; }
.status-pending { background: var(--warning-light); color: #92400e; }
.status-in_progress { background: var(--info-light); color: #1e40af; }
.status-cancelled, .status-rejected { background: var(--danger-light); color: #991b1b; }
.status-paused { background: var(--gray-100); color: var(--gray-600); }
.status-delivered { background: #ddd6fe; color: #5b21b6; }
.status-revision { background: #fce7f3; color: #9d174d; }

/* =============================================
   GIG DETAIL PAGE
   ============================================= */
.gig-detail {
    padding: 32px 0;
}

.gig-detail-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}

.gig-gallery {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 32px;
}

.gig-gallery-main {
    aspect-ratio: 16/9;
    background: var(--bg-tertiary);
}

.gig-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gig-gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.gig-gallery-thumb {
    width: 80px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition-fast);
}

.gig-gallery-thumb.active, .gig-gallery-thumb:hover {
    border-color: var(--primary);
}

.gig-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gig-detail-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.gig-detail-seller {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.gig-detail-seller img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.gig-detail-seller-info h4 {
    font-size: 15px;
    font-weight: 600;
}

.gig-detail-seller-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.gig-detail-description {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.gig-detail-description h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 24px 0 12px;
}

/* Pricing Sidebar */
.pricing-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: sticky;
    top: calc(var(--header-height) + 20px);
}

.pricing-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 2px solid var(--border-color);
}

.pricing-tab {
    padding: 14px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
}

.pricing-tab.active {
    background: var(--bg-primary);
    color: var(--primary);
    border-color: var(--primary);
}

.pricing-content {
    padding: 24px;
}

.pricing-content .price {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.pricing-content .package-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.pricing-features {
    margin-bottom: 20px;
}

.pricing-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.pricing-feature i {
    color: var(--success);
    font-size: 12px;
}

.pricing-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.pricing-meta i {
    margin-right: 4px;
}

/* =============================================
   PROFILE PAGE
   ============================================= */
.profile-page {
    padding: 32px 0;
}

.profile-header {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 32px;
}

.profile-cover {
    height: 200px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    position: relative;
}

.profile-info {
    display: flex;
    gap: 24px;
    padding: 0 32px 32px;
    margin-top: -50px;
    position: relative;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    border: 4px solid var(--bg-primary);
    object-fit: cover;
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
}

.profile-details {
    flex: 1;
    padding-top: 60px;
}

.profile-name {
    font-size: 24px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-tagline {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.profile-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-actions {
    display: flex;
    gap: 12px;
    padding-top: 60px;
    flex-shrink: 0;
}

.profile-content {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
}

.profile-sidebar-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.profile-sidebar-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.profile-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 14px;
}

.profile-stat-row span:first-child {
    color: var(--text-muted);
}

.profile-stat-row span:last-child {
    font-weight: 600;
}

/* =============================================
   MESSAGES PAGE
   ============================================= */
.messages-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    height: calc(100vh - var(--header-height) - var(--topbar-height));
}

.conversations-list {
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.conversations-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 1;
}

.conversations-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.conversation-item {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.conversation-item:hover, .conversation-item.active {
    background: var(--primary-50);
}

.conversation-item.unread {
    background: var(--bg-secondary);
}

.conversation-avatar {
    position: relative;
    flex-shrink: 0;
}

.conversation-avatar img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

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

.conversation-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.conversation-preview {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.chat-area {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
}

.chat-header {
    padding: 16px 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.5;
}

.message-bubble.sent {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-bubble.received {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

.chat-input-area {
    padding: 16px 24px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.chat-input-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input-form textarea {
    flex: 1;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    resize: none;
    max-height: 120px;
    font-size: 14px;
    background: var(--bg-secondary);
}

.chat-input-form textarea:focus {
    border-color: var(--primary);
}

/* =============================================
   SEARCH / FILTER PAGE
   ============================================= */
.search-page {
    padding: 32px 0;
}

.search-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
}

.search-filters {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: sticky;
    top: calc(var(--header-height) + 20px);
    height: fit-content;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-group h4 button {
    font-size: 12px;
    color: var(--primary);
    background: none;
}

.price-range {
    display: flex;
    gap: 8px;
    align-items: center;
}

.price-range input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.search-results-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.search-results-header .result-count {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 16px;
}

.sort-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.sort-selector select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    font-size: 13px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px 10px;
}

/* =============================================
   ADMIN PANEL
   ============================================= */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - var(--header-height));
}

.admin-sidebar {
    background: var(--bg-dark);
    color: var(--gray-400);
    padding: 24px 0;
}

.admin-sidebar .sidebar-link {
    color: var(--gray-400);
}

.admin-sidebar .sidebar-link:hover {
    color: white;
    background: rgba(255,255,255,0.08);
}

.admin-sidebar .sidebar-link.active {
    color: white;
    background: var(--primary);
}

.admin-main {
    padding: 32px;
    background: var(--bg-secondary);
}

/* Charts Placeholder */
.chart-container {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 14px;
}

/* =============================================
   ORDER DETAIL
   ============================================= */
.order-detail {
    padding: 32px 0;
}

.order-detail-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 32px;
}

.order-timeline {
    position: relative;
    padding-left: 24px;
}

.order-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
    padding-left: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    border: 3px solid var(--primary);
    background: var(--bg-primary);
}

.timeline-item.completed::before {
    background: var(--primary);
}

.timeline-item h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-item p {
    font-size: 13px;
    color: var(--text-secondary);
}

.timeline-item .time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* =============================================
   RESPONSIVE - COMPONENTS
   ============================================= */
@media (max-width: 992px) {
    .dashboard-layout, .admin-layout {
        grid-template-columns: 1fr;
    }
    .dashboard-sidebar, .admin-sidebar {
        display: none;
    }
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .gig-detail-grid {
        grid-template-columns: 1fr;
    }
    .profile-content {
        grid-template-columns: 1fr;
    }
    .messages-layout {
        grid-template-columns: 1fr;
    }
    .search-layout {
        grid-template-columns: 1fr;
    }
    .search-filters {
        position: static;
    }
    .order-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .auth-card {
        padding: 28px 20px;
    }
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    .dashboard-main, .admin-main {
        padding: 20px;
    }
    .profile-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 20px 24px;
    }
    .profile-details {
        padding-top: 12px;
    }
    .profile-actions {
        padding-top: 0;
        justify-content: center;
    }
    .profile-meta {
        justify-content: center;
    }
}
