:root {
    --primary-color: #006837;
    --secondary-color: #008542;
    --background-light: #ffffff;
    --text-light: #1f2937;
    --border-light: #e5e7eb;
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --header-height: 70px;
    --success: #22c55e;
    --success-hover: #16a34a;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --warning: #f59e0b;
    --info: #3b82f6;
    --info-hover: #2563eb;
    --gray: #6b7280;
    --gray-hover: #4b5563;
    --accent: #8b5cf6;
    --gradient-primary: linear-gradient(135deg, #006837 0%, #008542 100%);
    --gradient-secondary: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

[data-theme="dark"] {
    --primary-color: #008542;
    --secondary-color: #00a651;
    --background-light: #1f2937;
    --text-light: #f3f4f6;
    --border-light: #374151;
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background: var(--background-light);
    color: var(--text-light);
    transition: all 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--header-height);
    line-height: 1.6;
}

/* Header Styles */
header {
    background: var(--gradient-primary);
    padding: 0.5rem 0;
    box-shadow: var(--shadow-light);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
}

.header-content > div {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-align: center;
    font-family: 'Cairo', sans-serif;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* Side Menu Styles */
.side-menu {
    position: fixed;
    right: -100%;
    top: 0;
    width: 320px;
    height: 100vh;
    background: var(--background-light);
    box-shadow: var(--shadow-light);
    transition: right 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    padding: calc(var(--header-height) + 1rem) 1rem 1rem 1rem;
}

.side-menu.active {
    right: 0;
}

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

.menu-header h3 {
    color: var(--primary-color);
    font-weight: 700;
}

.menu-close {
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.menu-close:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.menu-items {
    list-style: none;
}

.menu-item {
    margin-bottom: 1rem;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0.75rem;
    font-weight: 500;
}

.menu-link:hover {
    background: var(--gradient-secondary);
    color: var(--primary-color);
    transform: translateX(-5px);
}

.menu-link i {
    margin-left: 0.75rem;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.submenu {
    list-style: none;
    margin-right: 2rem;
    margin-top: 0.5rem;
    display: none;
    background: rgba(0, 104, 55, 0.05);
    border-radius: 0.5rem;
    overflow: hidden;
}

.submenu.active {
    display: block;
}

.submenu .menu-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Main Container */
.main-container {
    flex: 1;
    position: relative;
    z-index: 1;
}

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

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--gradient-secondary);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-light);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.page-title i {
    color: var(--secondary-color);
}

.page-description {
    font-size: 1.2rem;
    color: var(--gray);
    font-weight: 500;
}

/* Statistics Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 0 1.5rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.stat-icon {
    background: var(--gradient-primary);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    direction: ltr;
    text-align: right;
}

.stat-label {
    color: var(--gray);
    font-weight: 500;
}

/* Section Cards */
.section-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.section-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

.section-header h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 600;
}

.section-header i {
    color: var(--secondary-color);
    font-size: 1.2rem;
}

/* Form Elements */
.message-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-light);
    border-radius: 0.75rem;
    font-family: 'Cairo', sans-serif;
    resize: vertical;
    min-height: 120px;
    font-size: 1rem;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.message-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 104, 55, 0.1);
}

.number-input, .search-input, .template-input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: 0.5rem;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.number-input:focus, .search-input:focus, .template-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 104, 55, 0.1);
}

.search-input {
    width: 100%;
}

.template-input {
    flex: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    color: white;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-family: 'Cairo', sans-serif;
    position: relative;
    overflow: hidden;
}

.btn:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.btn:hover:before {
    width: 300px;
    height: 300px;
}

.btn i {
    font-size: 1rem;
}

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

.btn-success:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 104, 55, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-hover) 100%);
    border: 2px solid var(--danger);
}

.btn-danger:hover {
    background: var(--danger-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--info) 0%, var(--info-hover) 100%);
    border: 2px solid var(--info);
}

.btn-primary:hover {
    background: var(--info-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

.btn-gray {
    background: linear-gradient(135deg, var(--gray) 0%, var(--gray-hover) 100%);
    border: 2px solid var(--gray);
}

.btn-gray:hover {
    background: var(--gray-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(107, 114, 128, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, var(--info) 0%, var(--info-hover) 100%);
    border: 2px solid var(--info);
}

.btn-info:hover {
    background: var(--info-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--primary-color);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(0, 104, 55, 0.02) 0%, rgba(0, 133, 66, 0.05) 100%);
}

.upload-area:hover {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, rgba(0, 104, 55, 0.05) 0%, rgba(0, 133, 66, 0.1) 100%);
    transform: translateY(-2px);
}

.upload-icon {
    color: var(--primary-color);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.upload-hint {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Progress Bar */
.progress-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-light);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: var(--primary-color);
    font-weight: 600;
}

/* Filter Controls */
.filter-controls {
    background: rgba(0, 104, 55, 0.02);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 2px solid rgba(0, 104, 55, 0.1);
}

.filter-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.filter-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.filter-option:hover {
    background: rgba(0, 104, 55, 0.1);
}

.filter-option input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Bulk Actions */
.bulk-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.bulk-sms {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.input-label {
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
}

/* Listing Cards */
.listing-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.listing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.listing-card.clicked {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.02) 0%, rgba(22, 163, 74, 0.05) 100%);
}

.listing-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
    margin-top: 2rem;
    line-height: 1.4;
}

.listing-details {
    color: var(--gray);
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.listing-url {
    color: var(--info);
    text-decoration: none;
    display: block;
    margin-bottom: 1.5rem;
    word-break: break-all;
    font-size: 0.9rem;
    padding: 0.5rem;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 0.5rem;
}

.listing-url:hover {
    text-decoration: underline;
    background: rgba(59, 130, 246, 0.1);
}

/* Phone Numbers */
.phone-number {
    background: var(--gradient-secondary);
    padding: 1.25rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.phone-number:hover {
    transform: translateX(-5px);
    border-color: var(--primary-color);
}

.phone-number.clicked {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(22, 163, 74, 0.15) 100%);
    border-color: var(--success);
}

.number-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    direction: ltr;
    text-align: right;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.action-buttons .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.btn-call {
    background: var(--info);
    border: 2px solid var(--info);
}

.btn-call:hover {
    background: var(--info-hover);
}

.btn-whatsapp {
    background: #25D366;
    border: 2px solid #25D366;
}

.btn-whatsapp:hover {
    background: #128C7E;
}

.btn-sms {
    background: var(--warning);
    border: 2px solid var(--warning);
}

.btn-sms:hover {
    background: #d97706;
}

/* Control Buttons */
.delete-button, .edit-button {
    position: absolute;
    top: 1rem;
    background: white;
    border: 2px solid;
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-button {
    left: 1rem;
    color: var(--danger);
    border-color: var(--danger);
}

.delete-button:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

.edit-button {
    left: 3.5rem;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.edit-button:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.select-checkbox {
    position: absolute;
    top: 1rem;
    right: 1rem;
    transform: scale(1.5);
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Export Controls */
.export-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Edit Form */
.edit-form {
    padding: 1.5rem;
    background: rgba(0, 104, 55, 0.02);
    border-radius: 1rem;
    border: 2px solid rgba(0, 104, 55, 0.1);
}

.edit-form h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

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

.edit-title, .edit-details, .edit-url, .edit-numbers {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-family: 'Cairo', sans-serif;
    background: white;
    transition: all 0.3s ease;
}

.edit-title:focus, .edit-details:focus, .edit-url:focus, .edit-numbers:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 104, 55, 0.1);
}

.edit-details, .edit-numbers {
    min-height: 100px;
    resize: vertical;
}

/* Floating Buttons */
.floating-buttons {
    position: fixed;
    left: 1.5rem;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 90;
}

.float-button {
    background: var(--gradient-primary);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 104, 55, 0.3);
    transition: all 0.3s ease;
    border: none;
    font-size: 1.2rem;
}

.float-button:hover {
    transform: scale(1.1);
    background: var(--secondary-color);
    box-shadow: 0 6px 20px rgba(0, 104, 55, 0.4);
}

/* Notification */
.notification {
    position: fixed;
    top: calc(var(--header-height) + 20px);
    right: 20px;
    padding: 1rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 104, 55, 0.3);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

/* Footer */
footer {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    margin-top: 3rem;
    border-top: 4px solid var(--secondary-color);
}

.footer-content p {
    margin: 0;
    font-weight: 600;
}

.footer-subtitle {
    margin-top: 0.5rem !important;
    opacity: 0.9;
    font-size: 0.9rem;
    font-weight: 400 !important;
}

/* Template Controls */
.template-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .page-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }
    
    .container {
        padding: 1rem;
    }
    
    .section-card {
        padding: 1.5rem;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .page-title {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .page-description {
        font-size: 1rem;
    }
    
    .side-menu {
        width: 85%;
        max-width: 300px;
    }
    
    .bulk-actions {
        flex-direction: column;
    }
    
    .export-controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .phone-number {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .floating-buttons {
        left: 1rem;
        bottom: 1rem;
    }
    
    .float-button {
        width: 45px;
        height: 45px;
    }
    
    .filter-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }
    
    .section-card {
        padding: 1rem;
    }
    
    .page-header {
        padding: 1.5rem 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .stats-container {
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .stat-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .filter-options {
        grid-template-columns: 1fr;
    }
    
    .template-controls {
        flex-direction: column;
    }
    
    .edit-form {
        padding: 1rem;
    }
}

/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Dark Mode Support */
[data-theme="dark"] .section-card {
    background: #1f2937;
    border-color: #374151;
}

[data-theme="dark"] .stat-card {
    background: #1f2937;
}

[data-theme="dark"] .listing-card {
    background: #1f2937;
}

[data-theme="dark"] .phone-number {
    background: rgba(55, 65, 81, 0.3);
}

[data-theme="dark"] .upload-area {
    background: rgba(31, 41, 55, 0.5);
}

/* Print Styles */
@media print {
    .floating-buttons,
    .side-menu,
    header,
    footer,
    .btn,
    .upload-area,
    .section-header,
    .stats-container {
        display: none !important;
    }
    
    body {
        padding-top: 0;
        background: white;
    }
    
    .main-container {
        margin: 0;
    }
    
    .section-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}