/* CorePOS - Main CSS File */
/* Copyright (C) 2025 CorePOS Development Team */

/* ============================================
   CSS VARIABLES
   ============================================ */

:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --gray: #e9ecef;
    
    /* Theming */
    --bg-body: #f5f7fa;
    --bg-card: #ffffff;
    --text-main: var(--dark);
    --text-muted: #6c757d;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
    --transition: all 0.3s ease;
}

/* Dark theme */
body.theme-dark {
    --bg-body: #050816;
    --bg-card: #020617;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --light: #0b1120;
    --gray: #1f2937;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */

.corepos-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* ============================================
   MODAL STYLES
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.modal-container {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

body.theme-dark .modal-container {
    background: #020617;
    border: 1px solid var(--gray);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--text-main);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--light);
    color: var(--text-main);
}

body.theme-dark .modal-close:hover {
    background: var(--gray);
}

.modal-body {
    padding: 20px;
    color: var(--text-main);
}

.modal-description {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.5;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--gray);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================
   FORM CONTROLS
   ============================================ */

.form-control {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #212529;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.badge-info {
    background: #17a2b8;
    color: white;
}

/* ============================================
   MESSAGES
   ============================================ */

.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transition: opacity 0.3s ease;
    max-width: 400px;
}

.message-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.message-error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.message-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.message-info {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-75 {
    opacity: 0.75;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .modal-container {
        width: 95%;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}
