/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-brand h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background-color: var(--secondary-color);
    cursor: not-allowed;
    transform: none;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-text {
    background: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
}

.btn-text:hover {
    color: var(--primary-color);
    background-color: var(--bg-tertiary);
}

/* Features Section */
.features {
    padding: 5rem 0;
    background-color: var(--bg-secondary);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background-color: var(--bg-primary);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* How It Works Section */
.how-it-works {
    padding: 5rem 0;
    background-color: var(--bg-primary);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.step {
    text-align: center;
    padding: 2rem 1rem;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
}

.step h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.step p {
    color: var(--text-secondary);
}

/* Login Section */
.login-section {
    padding: 5rem 0;
    background-color: var(--bg-secondary);
    min-height: 100vh;
}

.login-card {
    max-width: 500px;
    margin: 0 auto;
    background-color: var(--bg-primary);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
}

.login-card h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-primary);
}

.login-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    transition: border-color 0.2s ease;
}

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

.form-input::placeholder {
    color: var(--text-secondary);
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.message-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.message-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.message-icon {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.footer {
    background-color: var(--text-primary);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

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

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

    .login-card {
        padding: 2rem 1.5rem;
    }

    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 4rem 0;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .btn-large {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .features,
    .how-it-works {
        padding: 3rem 0;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Accessibility */
.btn:focus,
.form-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Touch-friendly tap targets for mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ========================================
   DASHBOARD STYLES
   ======================================== */

/* Dashboard Body */
.dashboard-body {
    background-color: var(--bg-secondary);
    height: 100vh;
    overflow: hidden;
}

/* Dashboard Navigation */
.dashboard-navbar {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
}

.dashboard-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-icon {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.btn-icon:hover {
    background-color: var(--bg-tertiary);
}

.btn-icon .icon {
    font-size: 1.25rem;
}

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    height: calc(100vh - 73px); /* Subtract navbar height */
    overflow: hidden;
}

/* Conversations Sidebar */
.conversations-sidebar {
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Conversations List */
.conversations-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.conversation-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

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

.conversation-item.active {
    background-color: var(--bg-tertiary);
    border-left: 3px solid var(--primary-color);
}

.conversation-subject {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-preview {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.meta-separator {
    color: var(--border-color);
}

/* Loading Skeleton */
.loading-skeleton {
    padding: 1rem 1.25rem;
}

.skeleton-item {
    height: 80px;
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Empty State */
.empty-state {
    padding: 3rem 2rem;
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Error State */
.error-state {
    padding: 3rem 2rem;
    text-align: center;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.error-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Load More Container */
.load-more-container {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* Conversation Detail */
.conversation-detail {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-secondary);
}

/* Welcome State */
.welcome-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}

.welcome-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
}

.welcome-state h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.welcome-state p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 500px;
    line-height: 1.6;
}

/* Loading State */
.loading-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.spinner-large {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.8s linear infinite;
}

.loading-state p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Conversation Header */
.conversation-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-back {
    display: none;
}

.conversation-info {
    flex: 1;
}

.conversation-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Message */
.message {
    background-color: var(--bg-primary);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.message.incoming {
    border-left: 4px solid var(--primary-color);
}

.message.outgoing {
    border-left: 4px solid var(--success-color);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.message-sender {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.message-timestamp {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.message-content {
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Attachments */
.message-attachments {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.attachments-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.attachment-item:hover {
    background-color: var(--bg-tertiary);
}

.attachment-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

.attachment-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.attachment-download {
    flex-shrink: 0;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.attachment-loading {
    flex-shrink: 0;
}

.attachment-loading .spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-color: var(--border-color);
    border-top-color: var(--primary-color);
}

/* Image Preview */
.attachment-preview {
    margin-top: 0.75rem;
    border-radius: 0.5rem;
    overflow: hidden;
    max-width: 100%;
}

.attachment-preview img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.toast-error {
    background-color: var(--error-color);
    color: white;
}

.toast-icon {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Responsive Design for Dashboard */
@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 320px 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 0 15px;
    }

    .user-email {
        display: none;
    }

    .dashboard-layout {
        grid-template-columns: 1fr;
        position: relative;
    }

    .conversations-sidebar {
        position: relative;
        z-index: 1;
    }

    .conversation-detail {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .conversation-detail.mobile-active {
        transform: translateX(0);
    }

    .mobile-back {
        display: block;
    }

    .conversation-header {
        padding: 1rem 1.25rem;
    }

    .conversation-header h2 {
        font-size: 1.25rem;
    }

    .messages-container {
        padding: 1rem;
    }

    .message {
        padding: 1rem;
    }

    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

@media (max-width: 480px) {
    .nav-brand h1 {
        font-size: 1.25rem;
    }

    .btn-small {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }

    .sidebar-header {
        padding: 1rem;
    }

    .sidebar-header h2 {
        font-size: 1.125rem;
    }

    .conversation-item {
        padding: 0.875rem 1rem;
    }

    .conversation-header {
        padding: 0.875rem 1rem;
    }

    .conversation-header h2 {
        font-size: 1.125rem;
    }

    .messages-container {
        padding: 0.75rem;
    }

    .message {
        padding: 0.875rem;
        margin-bottom: 1rem;
    }
}

/* Scrollbar Styling */
.conversations-list::-webkit-scrollbar,
.messages-container::-webkit-scrollbar {
    width: 8px;
}

.conversations-list::-webkit-scrollbar-track,
.messages-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.conversations-list::-webkit-scrollbar-thumb,
.messages-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.conversations-list::-webkit-scrollbar-thumb:hover,
.messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ========================================
   ENHANCED ERROR AND LOADING STATES
   ======================================== */

/* Timeout Warning */
.timeout-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.timeout-warning-icon {
    font-size: 1.25rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay-content {
    background-color: var(--bg-primary);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    text-align: center;
    max-width: 400px;
}

.loading-overlay-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

.loading-overlay-text {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.loading-overlay-subtext {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Inline Loading Indicator */
.inline-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.inline-loading .spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* Error Banner */
.error-banner {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
    border-left: 4px solid #ef4444;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.error-banner-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.error-banner-content {
    flex: 1;
}

.error-banner-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.error-banner-message {
    font-size: 0.875rem;
    line-height: 1.5;
}

.error-banner-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

/* Success Banner */
.success-banner {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
    border-left: 4px solid #10b981;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.success-banner-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* Retry Button */
.btn-retry {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.btn-retry:disabled {
    background-color: var(--secondary-color);
    cursor: not-allowed;
}

/* Skeleton Loading Improvements */
.skeleton-item {
    position: relative;
    overflow: hidden;
}

.skeleton-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.5) 50%,
        transparent 100%
    );
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Pulse Animation for Loading States */
@keyframes pulse-opacity {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse-loading {
    animation: pulse-opacity 1.5s ease-in-out infinite;
}

/* Disabled State */
.disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

/* Network Status Indicator */
.network-status {
    position: fixed;
    top: 4rem;
    right: 1rem;
    background-color: var(--error-color);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.network-status.online {
    background-color: var(--success-color);
}

.network-status-icon {
    font-size: 1rem;
}

/* Toast Improvements */
.toast {
    max-width: 400px;
    word-wrap: break-word;
}

.toast.toast-warning {
    background-color: #f59e0b;
    color: white;
}

/* Loading Button State */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Responsive Toast for Mobile */
@media (max-width: 768px) {
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
    
    .network-status {
        top: auto;
        bottom: 5rem;
        right: 1rem;
        left: 1rem;
    }
}
