/* Global Styles for ASHOKA JEWELLERS */

/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Color Variables */
:root {
    /* Common colors */
    --gold-primary: #b8860b;
    --gold-secondary: #daa520;
    --gold-light: #ffd700;
    --error-color: #e74c3c;
    --success-color: #27ae60;
    --transition-speed: 0.3s;
    
    /* Light Theme (default) */
    --text-color: #333;
    --text-secondary: #666;
    --bg-color: #f5f5f5;
    --card-bg: #fff;
    --header-bg: #fff;
    --border-color: #ddd;
    --dark-accent: #222;
    --light-accent: #f9f9f9;
    --shadow-color: rgba(0,0,0,0.08);
    --hover-bg: rgba(0,0,0,0.05);
}

/* Dark Theme */
[data-theme="dark"] {
    --text-color: #e0e0e0;
    --text-secondary: #aaa;
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --header-bg: #252525;
    --border-color: #444;
    --dark-accent: #111;
    --light-accent: #333;
    --shadow-color: rgba(0,0,0,0.3);
    --hover-bg: rgba(255,255,255,0.05);
}

/* Apply transitions to elements for smooth theme switching */
.dashboard-header,
.sidebar,
.main-content,
.card,
.customer-card,
input,
select,
textarea,
button,
table,
th,
td {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Text utility classes */
.gold-text {
    color: var(--gold-primary);
}

/* Enhanced Form Styles */
.form-group {
    position: relative;
    margin-bottom: 25px;
}

.form-group.focused label {
    transform: translateY(-20px);
    font-size: 0.8rem;
    color: var(--gold-primary);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    transition: all var(--transition-speed);
    background-color: var(--card-bg);
    color: var(--text-color);
}

.form-group input:focus {
    border-color: var(--gold-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.1);
}

/* Settings Modal Styles */
.modal-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.modal-header {
    padding: 15px 20px;
    background: var(--light-accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 18px;
}

.close-modal {
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: var(--text-secondary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

/* Settings Styles */
.settings-section {
    margin-bottom: 25px;
}

.settings-section h3 {
    margin-bottom: 15px;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-label {
    flex: 1;
}

.setting-label span {
    display: block;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 5px;
}

.setting-label small {
    color: var(--text-secondary);
    font-size: 12px;
}

.setting-control {
    margin-left: 15px;
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

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

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

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

input:checked + .toggle-slider {
    background-color: var(--gold-primary);
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px var(--gold-primary);
}

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

/* Button Styles */
.btn {
    background: linear-gradient(90deg, var(--gold-primary), var(--gold-secondary));
    color: white;
    border: none;
    border-radius: 5px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.btn:hover {
    background: linear-gradient(90deg, var(--gold-secondary), var(--gold-primary));
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--shadow-color);
}

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

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner Animation */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

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

[data-theme="dark"] .loading-overlay {
    background-color: rgba(0, 0, 0, 0.8);
}

.loading-overlay .spinner {
    width: 50px;
    height: 50px;
    border-width: 3px;
    margin-bottom: 20px;
}

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-top: 10px;
}

/* Message Styles */
.error-message {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: none;
    font-size: 14px;
    border-left: 3px solid var(--error-color);
    animation: fadeIn 0.3s ease-in-out;
}

.success-message {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: none;
    font-size: 14px;
    border-left: 3px solid var(--success-color);
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header Styles */
.dashboard-header {
    background-color: var(--header-bg);
    box-shadow: 0 3px 10px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.text-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0;
    line-height: 1.2;
    background: linear-gradient(90deg, var(--gold-primary), var(--gold-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-logo p {
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0;
    color: var(--gold-primary);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

#username-display {
    font-weight: 500;
    color: var(--text-color);
}

.logout-btn {
    color: var(--gold-primary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid var(--gold-primary);
    transition: all var(--transition-speed);
}

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

/* Sidebar Toggle Button */
.sidebar-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.sidebar-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
}

.sidebar-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.sidebar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 90;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.dashboard-container {
    display: flex;
    min-height: calc(100vh - 60px);
    position: relative;
}

.sidebar {
    width: 250px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s ease;
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    z-index: 95;
    overflow-y: auto;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav ul li {
    margin-bottom: 5px;
}

.sidebar nav ul li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all var(--transition-speed);
    border-left: 3px solid transparent;
}

.sidebar nav ul li a:hover {
    background-color: var(--hover-bg);
    border-left-color: var(--gold-secondary);
}

.sidebar nav ul li.active a {
    background-color: var(--hover-bg);
    border-left-color: var(--gold-primary);
    font-weight: 600;
}

.sidebar nav ul li a i {
    margin-right: 10px;
    font-size: 1.1rem;
    min-width: 24px;
    text-align: center;
}

.main-content {
    flex: 1;
    padding: 20px;
    margin-left: 250px;
    transition: margin-left 0.3s ease;
}

body.sidebar-open .main-content {
    margin-left: 250px;
}

.main-content h1 {
    margin-bottom: 25px;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-color);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 15px;
    border-radius: 4px;
    box-shadow: 0 2px 10px var(--shadow-color);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

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

.notification.error {
    background-color: rgba(231, 76, 60, 0.1);
    border-left: 3px solid var(--error-color);
}

.notification.success {
    background-color: rgba(39, 174, 96, 0.1);
    border-left: 3px solid var(--success-color);
}

.notification p {
    margin: 0;
    color: var(--text-color);
}

.close-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    cursor: pointer;
}

.primary-btn, .secondary-btn {
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: inline-block;
}

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

.primary-btn:hover {
    background-color: var(--gold-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--shadow-color);
}

.secondary-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

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

.primary-btn.disabled, .secondary-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        transform: translateX(-280px);
        box-shadow: none;
    }
    
    .sidebar.active {
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
        transform: translateX(0);
    }
    
    body.sidebar-open .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .header-content {
        padding: 10px 15px;
    }
    
    .text-logo h1 {
        font-size: 1.3rem;
    }
    
    .text-logo p {
        font-size: 0.7rem;
    }
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.4s ease-out;
}

.fade-in-left {
    animation: fadeInLeft 0.4s ease-out;
} 