:root {
    /* Home Mode Colors (Vibrant, Modern) */
    --bg-color-home: #0f172a;
    --surface-color-home: #1e293b;
    --primary-color-home: #3b82f6;
    --text-primary-home: #f8fafc;
    --text-sec-home: #94a3b8;
    --accent-home: #8b5cf6;

    /* Office Mode Colors (Dull, Corporate, Stealth) */
    --bg-color-office: #ffffff;
    --surface-color-office: #f3f4f6;
    --primary-color-office: #4b5563;
    --text-primary-office: #111827;
    --text-sec-office: #6b7280;
    --accent-office: #9ca3af;

    /* Active vars */
    --bg-color: var(--bg-color-home);
    --surface-color: var(--surface-color-home);
    --primary-color: var(--primary-color-home);
    --text-primary: var(--text-primary-home);
    --text-sec: var(--text-sec-home);
    --accent-color: var(--accent-home);

    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    transition: all 0.4s ease;
}

body.office-mode {
    --bg-color: var(--bg-color-office);
    --surface-color: var(--surface-color-office);
    --primary-color: var(--primary-color-office);
    --text-primary: var(--text-primary-office);
    --text-sec: var(--text-sec-office);
    --accent-color: var(--accent-office);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 800px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--surface-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    transition: background-color 0.4s ease;
}

.office-mode .app-container {
    box-shadow: none;
    max-width: 100%;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
}

/* Header */
.app-header {
    height: 70px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
}

.office-mode .app-header {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 600;
}

.office-mode .logo i {
    display: none;
    /* Hide ghost icon in office mode */
}

/* Restore Button */
.restore-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-sec);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.restore-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.office-mode .restore-btn {
    border-color: #d1d5db;
}

/* Toggle Switch */
.mode-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mode-label {
    font-size: 0.875rem;
    color: var(--text-sec);
    transition: color 0.3s;
}

.home-label {
    color: var(--primary-color-home);
    font-weight: 500;
}

.office-label {
    opacity: 0.5;
}

body.office-mode .home-label {
    color: var(--text-sec);
    opacity: 0.5;
    font-weight: normal;
}

body.office-mode .office-label {
    color: var(--primary-color-office);
    opacity: 1;
    font-weight: 500;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3b82f6;
    transition: .4s;
    border-radius: 34px;
}

.office-mode .slider {
    background-color: #d1d5db;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider:before {
    transform: translateX(22px);
    background-color: #4b5563;
}

/* Timeline */
.timeline-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.timeline-container::-webkit-scrollbar {
    width: 6px;
}

.timeline-container::-webkit-scrollbar-thumb {
    background: var(--text-sec);
    border-radius: 10px;
}

/* Message Bubble */
.message {
    align-self: flex-end;
    /* user messages on right */
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    border-bottom-right-radius: 4px;
    max-width: 80%;
    word-break: break-word;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease forwards;
    position: relative;
    /* For the delete button positioning */
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.office-mode .message {
    background: #e5e7eb;
    color: #111827;
    box-shadow: none;
    border: 1px solid #d1d5db;
}

/* Delete Button */
.msg-delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.message:hover .msg-delete-btn {
    opacity: 1;
}

.msg-delete-btn:hover {
    transform: scale(1.1);
    background: #dc2626;
}

.office-mode .msg-delete-btn {
    background: #9ca3af;
}

.file-message {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.file-message:hover {
    opacity: 0.9;
}

.file-icon {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.office-mode .file-icon {
    background: white;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.file-info {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.file-meta {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Input Area */
.input-area {
    padding: 20px 24px;
    background: var(--surface-color);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.office-mode .input-area {
    border-top: 1px solid #e5e7eb;
}

.drop-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.drop-indicator.active {
    opacity: 1;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-color);
    padding: 8px 16px;
    border-radius: 30px;
    position: relative;
    border: 1px solid transparent;
}

.office-mode .input-wrapper {
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

.hidden-input {
    display: none;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-sec);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 8px;
}

.icon-btn:hover {
    color: var(--primary-color);
}

.text-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    padding: 0 4px;
}

.text-input::placeholder {
    color: var(--text-sec);
}

.upload-progress-container {
    position: absolute;
    left: 0;
    right: 0;
    top: -50px;
    background: var(--surface-color);
    border-radius: 8px 8px 0 0;
    padding: 8px 16px;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.office-mode .upload-progress-container {
    background: #e5e7eb;
    border-top: 1px solid #d1d5db;
}

.progress-bar-track {
    height: 4px;
    background: rgba(150, 150, 150, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.upload-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    transition: width 0.2s;
}

.progress-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-sec);
}

.cancel-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cancel-btn:hover {
    color: #dc2626;
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
    .app-container {
        border-radius: 0;
    }

    .message {
        max-width: 90%;
    }
}

/* Office Mode Gallery (Pinterest/ArtStation Style) */
.timeline-container.gallery-view {
    display: block;
    column-count: 3;
    column-gap: 20px;
    background: #f3f4f6;
    padding: 24px;
}

@media (max-width: 800px) {
    .timeline-container.gallery-view {
        column-count: 2;
    }
}

@media (max-width: 500px) {
    .timeline-container.gallery-view {
        column-count: 1;
    }
}

.gallery-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: inline-block;
    width: 100%;
    break-inside: avoid;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
}

.artwork-link {
    display: block;
    position: relative;
    text-decoration: none;
}

.artwork-thumb {
    width: 100%;
    display: block;
    object-fit: cover;
}

.artwork-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.gallery-card:hover .artwork-overlay {
    opacity: 1;
}

.artwork-dl-btn {
    background: #ef4444;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
}

.artwork-meta {
    padding: 16px;
}

.artwork-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: #111827;
}

.artwork-stats {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: #6b7280;
}

.artwork-comment {
    padding: 16px;
    font-size: 0.9rem;
    color: #374151;
}

.comment-author {
    font-weight: 700;
    margin-bottom: 6px;
    color: #111827;
}

.gallery-card .msg-delete-btn {
    z-index: 10;
}