/* Client Portal - Alpha2Zulu Marketing */
/* Brand Colors: Primary #6C5CE7 (purple), Gradient to #a29bfe */

:root {
    --primary: #6C5CE7;
    --primary-light: #a29bfe;
    --primary-dark: #5541d6;
    --gradient: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 100%);

    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #d63031;
    --info: #0984e3;

    --dark: #2d3436;
    --gray-900: #1a1a2e;
    --gray-800: #2d2d44;
    --gray-700: #404060;
    --gray-600: #636e72;
    --gray-500: #b2bec3;
    --gray-400: #dfe6e9;
    --gray-300: #f0f0f5;
    --gray-200: #f5f6fa;
    --white: #ffffff;

    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--gray-200);
    color: var(--dark);
    line-height: 1.6;
}

/* Portal Layout */
.portal-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--gray-800);
}

.brand-logo {
    width: 45px;
    height: 45px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -1px;
}

.brand-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--white);
}

.client-info {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--gray-800);
}

.client-avatar {
    width: 42px;
    height: 42px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.client-details {
    display: flex;
    flex-direction: column;
}

.client-company {
    font-weight: 600;
    font-size: 14px;
    color: var(--white);
}

.client-name {
    font-size: 12px;
    color: var(--gray-500);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--gray-500);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--gray-800);
    color: var(--white);
}

.nav-item.active {
    background: var(--primary);
    color: var(--white);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}

.nav-cta {
    background: var(--gradient);
    color: var(--white) !important;
    margin-top: 10px;
}

.nav-cta:hover {
    opacity: 0.9;
    background: var(--gradient);
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--gray-800);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    background: var(--white);
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-400);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

.header-title .subtitle {
    font-size: 14px;
    color: var(--gray-600);
    margin-top: 4px;
}

.welcome-text {
    font-size: 14px;
    color: var(--gray-600);
}

.content-area {
    flex: 1;
    padding: 32px;
}

.portal-footer {
    padding: 20px 32px;
    text-align: center;
    color: var(--gray-600);
    font-size: 13px;
    border-top: 1px solid var(--gray-400);
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

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

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

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-400);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.purple { background: rgba(108, 92, 231, 0.1); color: var(--primary); }
.stat-icon.blue { background: rgba(9, 132, 227, 0.1); color: var(--info); }
.stat-icon.orange { background: rgba(253, 203, 110, 0.2); color: #e17055; }
.stat-icon.green { background: rgba(0, 184, 148, 0.1); color: var(--success); }

.stat-content h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
}

.stat-content p {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 4px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--gradient);
    color: var(--white);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-300);
    color: var(--dark);
}

.btn-secondary:hover {
    background: var(--gray-400);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-400);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

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

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 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-new {
    background: var(--primary);
    color: var(--white);
}

.badge-progress {
    background: var(--info);
    color: var(--white);
}

.badge-pending {
    background: var(--warning);
    color: var(--dark);
}

.badge-completed {
    background: var(--success);
    color: var(--white);
}

.badge-closed {
    background: var(--gray-600);
    color: var(--white);
}

/* Priority */
.priority {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.priority-low { background: #e8f5e9; color: #2e7d32; }
.priority-normal { background: #e3f2fd; color: #1565c0; }
.priority-high { background: #fff3e0; color: #e65100; }
.priority-urgent { background: #ffebee; color: #c62828; }

/* Request List */
.request-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.request-item {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
}

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

.request-item.has-unread {
    border-left: 4px solid var(--primary);
}

.request-id {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
    min-width: 60px;
}

.request-main {
    flex: 1;
}

.request-subject {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.request-meta {
    font-size: 13px;
    color: var(--gray-600);
}

.request-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.request-date {
    font-size: 12px;
    color: var(--gray-500);
}

/* Message Thread */
.message-thread {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.message {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: 16px;
    position: relative;
}

.message.client {
    background: var(--gradient);
    color: var(--white);
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.message.admin {
    background: var(--white);
    border: 1px solid var(--gray-400);
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    opacity: 0.8;
}

.message.admin .message-sender {
    color: var(--primary);
}

.message-content {
    font-size: 14px;
    line-height: 1.6;
}

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

.message.admin .message-time {
    color: var(--gray-500);
}

/* Reply Form */
.reply-form {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.reply-form textarea {
    margin-bottom: 16px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 40px;
}

.empty-state i {
    font-size: 64px;
    color: var(--gray-400);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-600);
    margin-bottom: 24px;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 10px 20px;
    background: var(--white);
    border: 2px solid var(--gray-400);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 48px;
    width: 100%;
    max-width: 420px;
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand .brand-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    font-size: 20px;
}

.login-brand h1 {
    font-size: 24px;
    color: var(--dark);
    margin-bottom: 4px;
}

.login-brand p {
    font-size: 14px;
    color: var(--gray-600);
}

.login-form .btn {
    width: 100%;
    margin-top: 8px;
}

/* Request Detail */
.request-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.request-detail-header h2 {
    font-size: 22px;
    color: var(--dark);
    margin-bottom: 8px;
}

.request-detail-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.meta-item {
    font-size: 13px;
    color: var(--gray-600);
}

.meta-item strong {
    color: var(--dark);
}

/* Timeline */
.activity-timeline {
    position: relative;
    padding-left: 24px;
}

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

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--white);
}

.timeline-content {
    font-size: 13px;
    color: var(--gray-600);
}

.timeline-content strong {
    color: var(--dark);
}

.timeline-time {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--gray-400);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

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

.file-upload input[type="file"] {
    display: none;
}

.file-upload i {
    font-size: 32px;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.file-upload p {
    font-size: 14px;
    color: var(--gray-600);
}

.file-list {
    margin-top: 16px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--gray-200);
    border-radius: 6px;
    margin-bottom: 8px;
}

.file-item i {
    color: var(--primary);
}

.file-item span {
    flex: 1;
    font-size: 13px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.page-link {
    padding: 8px 14px;
    background: var(--white);
    border: 1px solid var(--gray-400);
    border-radius: 6px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.page-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 20px;
}

.quick-action-text h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
}

.quick-action-text p {
    font-size: 12px;
    color: var(--gray-600);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .content-area {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .request-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .request-status {
        align-items: flex-start;
        flex-direction: row;
        gap: 12px;
    }

    .message {
        max-width: 95%;
    }

    .login-card {
        padding: 32px 24px;
    }
}
