/* Common styles for CRM Stomatology */

/* Reset & Base */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Typography */
h1 {
    color: #333;
    text-align: center;
    margin-bottom: 20px;
}

h2 {
    color: #333;
    margin-bottom: 15px;
}

/* Navigation */
.nav {
    text-align: center;
    margin: 20px 0;
}

.nav a, .nav button {
    display: inline-block;
    padding: 10px 20px;
    margin: 5px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s, transform 0.1s;
}

.nav a:hover, .nav button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.nav .active {
    background-color: #0056b3;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

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

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

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

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

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

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

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

.data-table .actions {
    display: flex;
    gap: 8px;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
}

.form-actions {
    text-align: right;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.form-actions button {
    margin-left: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.2s;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Search */
.search-box {
    margin: 20px 0;
}

.search-box input {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-card.success {
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

.stat-card.warning {
    background: linear-gradient(135deg, #ffc107, #d39e00);
    color: #333;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Quick Stats (smaller version) */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.stat-item .stat-number {
    font-size: 1.5rem;
    color: #007bff;
}

.stat-item .stat-label {
    font-size: 0.8rem;
    color: #666;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.quick-action-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.quick-action-card:hover {
    border-color: #007bff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,123,255,0.15);
}

.quick-action-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
}

.quick-action-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.quick-action-desc {
    color: #666;
    font-size: 0.85rem;
}

/* Toast Notifications */
#toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#toast.show {
    transform: translateX(0);
}

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

#toast.error {
    background-color: #dc3545;
}

#toast.info {
    background-color: #007bff;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Error State */
.error-state {
    background-color: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-scheduled {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-completed {
    background-color: #e8f5e9;
    color: #388e3c;
}

.status-cancelled {
    background-color: #ffebee;
    color: #d32f2f;
}

/* Welcome message */
.welcome {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    .nav a, .nav button {
        padding: 8px 12px;
        font-size: 12px;
        margin: 3px;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 15px;
    }
}
