/* 
   Email Automation Dashboard Styles
   Primary Color: #E78A53
   Base: White & Dark Charcoal
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #E78A53;
    --primary-dark: #d77741;
    --secondary-color: #ffffff;
    --dark-bg: #1C1C1C;
    --dark-gray: #2a2a2a;
    --light-gray: #f5f5f5;
    --text-dark: #1C1C1C;
    --text-light: #666;
    --border-color: #e0e0e0;
    --success: #4caf50;
    --danger: #f44336;
    --warning: #ff9800;
    --info: #2196f3;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --sidebar-width: 280px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-gray);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--dark-bg);
    color: white;
    padding: 0;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-header {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.close-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.nav-item:hover {
    background: var(--dark-gray);
    color: white;
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
    border-left: 4px solid var(--primary-dark);
}

.nav-item i {
    margin-right: 1rem;
    font-size: 1.2rem;
    width: 24px;
}

/* Overlay for mobile */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

/* Top Bar */
.topbar {
    background: white;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

.topbar h1 {
    font-size: 1.8rem;
    color: var(--text-dark);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--light-gray);
    border-radius: 20px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-dot.sending {
    background: var(--warning);
}

.status-dot.error {
    background: var(--danger);
}

/* Content Wrapper */
.content-wrapper {
    padding: 2rem;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Header */
.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.section-header h2 i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.section-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.card-header h3 {
    font-size: 1.3rem;
    flex-grow: 1;
}

.card-body {
    padding: 1.5rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Alert Cards */
.alert-info {
    background: #e3f2fd;
    border-left: 4px solid var(--info);
}

.alert-info h4 {
    color: var(--info);
    margin-bottom: 1rem;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: var(--light-gray);
}

.upload-area i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-area p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* File Preview */
.file-preview, .sheet-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 8px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.data-preview {
    max-height: 300px;
    overflow: auto;
}

.data-preview table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-preview th,
.data-preview td {
    padding: 0.5rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.data-preview th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group label i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.form-group small {
    margin-top: 0.25rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

.input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(231, 138, 83, 0.1);
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group .input {
    flex: 1;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--dark-gray);
    color: white;
}

.btn-secondary:hover {
    background: var(--dark-bg);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.2rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-light);
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--danger);
}

.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Send Status Cards */
.send-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.status-card {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.status-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.status-card i {
    font-size: 2rem;
    color: var(--primary-color);
}

.status-card h4 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.status-card p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Send Controls */
.send-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

/* Progress Bar */
.progress-container {
    margin-top: 2rem;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--light-gray);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transition: width 0.3s ease;
    border-radius: 15px;
}

.progress-text {
    text-align: center;
    color: var(--text-light);
    font-weight: 600;
}

/* Logs Container */
.logs-container {
    max-height: 600px;
    overflow-y: auto;
}

.log-entry {
    padding: 1rem;
    border-left: 4px solid var(--border-color);
    margin-bottom: 1rem;
    background: var(--light-gray);
    border-radius: 8px;
    transition: var(--transition);
}

.log-entry:hover {
    box-shadow: var(--shadow);
}

.log-entry.success {
    border-left-color: var(--success);
}

.log-entry.failed {
    border-left-color: var(--danger);
}

.log-entry.warning {
    border-left-color: var(--warning);
}

.log-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.log-to {
    font-weight: 600;
    color: var(--text-dark);
}

.log-time {
    color: var(--text-light);
    font-size: 0.85rem;
}

.log-subject {
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.log-status {
    font-weight: 600;
}

.log-status.success {
    color: var(--success);
}

.log-status.failed {
    color: var(--danger);
}

.log-status.warning {
    color: var(--warning);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-style: italic;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.example-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.example-table th,
.example-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.example-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.example-table tbody tr:hover {
    background: var(--light-gray);
}

/* Lists */
.requirements-list,
.tips-list,
.steps-list {
    padding-left: 1.5rem;
    line-height: 2;
}

.requirements-list li,
.tips-list li,
.steps-list li {
    margin-bottom: 0.5rem;
}

.requirements-list strong {
    color: var(--primary-color);
}

/* Help Text */
.help-text {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 260px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .close-btn {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .topbar h1 {
        font-size: 1.3rem;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .send-status {
        grid-template-columns: repeat(2, 1fr);
    }

    .send-controls {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .topbar {
        padding: 1rem;
    }

    .topbar h1 {
        font-size: 1.1rem;
    }

    .status-indicator {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .send-status {
        grid-template-columns: 1fr;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Loading Animation */
.loading {
    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 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
    }
    to {
        transform: translateX(0);
    }
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--info);
}

/* Liquid Glass Effect Toast Notifications */
.toast-glass {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 1.2rem 1.8rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 2000;
    animation: glassSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    color: var(--text-dark);
    font-weight: 600;
}

.toast-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
    z-index: -1;
}

.toast-glass i {
    font-size: 1.5rem;
}

.toast-glass.success {
    border-left: 4px solid var(--success);
    background: rgba(76, 175, 80, 0.1);
}

.toast-glass.success i {
    color: var(--success);
}

.toast-glass.error {
    border-left: 4px solid var(--danger);
    background: rgba(244, 67, 54, 0.1);
}

.toast-glass.error i {
    color: var(--danger);
}

.toast-glass.warning {
    border-left: 4px solid var(--warning);
    background: rgba(255, 152, 0, 0.1);
}

.toast-glass.warning i {
    color: var(--warning);
}

.toast-glass.info {
    border-left: 4px solid var(--info);
    background: rgba(33, 150, 243, 0.1);
}

.toast-glass.info i {
    color: var(--info);
}

@keyframes glassSlideIn {
    from {
        transform: translateX(400px) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* Completion Notification Overlay */
.completion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.completion-overlay.active {
    opacity: 1;
}

/* Liquid Glass Completion Notification */
.completion-notification {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: scale(0.8) translateY(-50px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.completion-notification.active {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.completion-notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.3), 
        rgba(255, 255, 255, 0.05));
    z-index: -1;
}

.completion-icon {
    font-size: 5rem;
    color: var(--success);
    margin-bottom: 1.5rem;
    animation: iconBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes iconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.completion-notification h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-dark);
    font-weight: 700;
}

.completion-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.stat-item.success {
    border-left: 4px solid var(--success);
}

.stat-item.failed {
    border-left: 4px solid var(--danger);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
}

.completion-rate {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.rate-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.rate-bar {
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.rate-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--primary-color));
    transition: width 1s ease;
    border-radius: 15px;
}

.rate-percentage {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
}

.btn-close-completion {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(231, 138, 83, 0.3);
}

.btn-close-completion:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 138, 83, 0.4);
}

.btn-close-completion i {
    margin-right: 0.5rem;
}

/* Mobile Responsive for Completion */
@media (max-width: 768px) {
    .completion-notification {
        padding: 2rem;
    }
    
    .completion-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .completion-icon {
        font-size: 3.5rem;
    }
    
    .completion-notification h2 {
        font-size: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}
