/* Admin Panel Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
}

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

/* Admin Header */
.admin-header {
    background: linear-gradient(135deg, #2d1b69 0%, #11998e 100%);
    color: white;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

.admin-header .admin-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-nav-brand h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.admin-nav-brand i {
    margin-right: 0.5rem;
    color: #38ef7d;
}

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

.admin-user {
    color: #38ef7d;
    font-weight: 500;
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Sidebar */
.admin-sidebar {
    position: fixed;
    left: 0;
    top: 80px;
    width: 260px;
    height: calc(100vh - 80px);
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 900;
    overflow-y: auto;
}

.admin-nav ul {
    list-style: none;
    padding: 2rem 0;
}

.admin-nav ul li {
    margin-bottom: 0.5rem;
}

.admin-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    color: #5a6c7d;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.admin-nav .nav-link:hover {
    background: #f8f9fa;
    color: #2c3e50;
    border-left-color: #ff6b35;
}

.admin-nav .nav-link.active {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(56, 239, 125, 0.1) 100%);
    color: #ff6b35;
    border-left-color: #ff6b35;
    font-weight: 600;
}

.admin-nav .nav-link i {
    margin-right: 1rem;
    font-size: 1.1rem;
    width: 20px;
}

/* Main Content */
.admin-main {
    margin-left: 260px;
    margin-top: 80px;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.section-header h2 {
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 600;
}

.section-header p {
    color: #5a6c7d;
    font-size: 1rem;
    margin: 0;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
    background: transparent;
    color: #5a6c7d;
    padding: 12px 24px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #ddd;
    color: #2c3e50;
}

.btn-success {
    background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(56, 239, 125, 0.4);
}

.btn-edit {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-delete {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #c0392b;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%);
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #2d1b69 0%, #11998e 100%);
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.stat-content p {
    color: #5a6c7d;
    font-weight: 500;
}

/* Dashboard Content */
.dashboard-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.recent-activity,
.quick-actions {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.recent-activity h3,
.quick-actions h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.activity-list {
    space-y: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item i {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    font-size: 0.9rem;
}

.activity-item span {
    flex: 1;
    color: #2c3e50;
    font-weight: 500;
}

.activity-item small {
    color: #5a6c7d;
    font-size: 0.85rem;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Tables */
.products-table-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.admin-table th {
    font-weight: 600;
    font-size: 0.95rem;
}

.admin-table tbody tr {
    transition: background-color 0.3s ease;
}

.admin-table tbody tr:hover {
    background-color: #f8f9fa;
}

.status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status.active {
    background: #d4edda;
    color: #155724;
}

.status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.status.draft {
    background: #fff3cd;
    color: #856404;
}

/* Discount Codes Styles */
.discounts-table-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.discount-code {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.discount-type {
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.discount-type.percentage {
    background: #e3f2fd;
    color: #1976d2;
}

.discount-type.fixed {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Discount Modal Specific Styles */
#discountModal .form-group small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #5a6c7d;
    line-height: 1.4;
}

#discountModal .modal-content {
    max-width: 700px;
}

#valueHint {
    font-style: italic;
}

/* Dark Mode Discount Styles */
body.dark-mode .discounts-table-container {
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.1);
}

body.dark-mode .discount-type.percentage {
    background: rgba(25, 118, 210, 0.2);
    color: #64b5f6;
}

body.dark-mode .discount-type.fixed {
    background: rgba(123, 31, 162, 0.2);
    color: #ba68c8;
}

/* Members Grid */
.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.search-box i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #5a6c7d;
}

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

.member-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.3s ease;
}

.member-card:hover {
    transform: translateY(-5px);
}

.member-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.member-info h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.member-info p {
    color: #5a6c7d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.member-date {
    color: #95a5a6;
    font-size: 0.8rem;
}

.member-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* Messages */
.messages-list {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.message-item {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.3s ease;
}

.message-item:hover {
    background-color: #f8f9fa;
}

.message-item:last-child {
    border-bottom: none;
}

.message-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1rem;
}

.message-sender {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.message-date {
    color: #5a6c7d;
    font-size: 0.9rem;
}

.message-subject {
    font-weight: 500;
    color: #ff6b35;
    margin-bottom: 0.5rem;
}

.message-content {
    color: #5a6c7d;
    line-height: 1.6;
}

.message-unread {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.05) 0%, rgba(56, 239, 125, 0.05) 100%);
    border-left: 4px solid #ff6b35;
}

/* Analytics */
.analytics-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.chart-container h3 {
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 1.3rem;
}

.chart-placeholder {
    height: 300px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #5a6c7d;
}

.chart-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ff6b35;
}

.popular-products {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.popular-products h3 {
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 1.3rem;
}

.product-stats {
    space-y: 1.5rem;
}

.product-stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.product-stat-item span:first-child {
    flex: 1;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.9rem;
}

.progress-bar {
    flex: 2;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.product-stat-item span:last-child {
    color: #5a6c7d;
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 40px;
}

/* Settings */
.settings-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.settings-group {
    margin-bottom: 3rem;
}

.settings-group h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.setting-item {
    margin-bottom: 1.5rem;
}

.setting-item label {
    display: block;
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.setting-item input,
.setting-item textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.setting-item input:focus,
.setting-item textarea:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.save-settings {
    margin-top: 2rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 3% auto;
    padding: 0;
    border: none;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin: 0;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal form {
    padding: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-group small {
    color: #5a6c7d;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: block;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1rem 2rem 2rem;
    border-top: 1px solid #e9ecef;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .admin-sidebar.show {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .dashboard-content {
        grid-template-columns: 1fr;
    }
    
    .analytics-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-header .admin-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .admin-nav-cta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .admin-main {
        padding: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .members-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal form {
        padding: 1.5rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .admin-main {
        padding: 0.5rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .recent-activity,
    .quick-actions {
        padding: 1.5rem;
    }
    
    .admin-table {
        font-size: 0.85rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.75rem 0.5rem;
    }
}