/* ==========================================================================
   Admitere Medicina - Reusable Components Stylesheet
   ==========================================================================

   Component Sections:
   1. Buttons
   2. Forms & Inputs
   3. Cards
   4. Navigation
   5. Modals & Dialogs
   6. Alerts & Messages
   7. Badges & Tags
   8. Tables
   9. Loaders & Spinners

   ========================================================================== */

/* ==========================================================================
   1. BUTTONS
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: var(--font-size-btn);
    font-weight: var(--font-weight-semibold);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition-default);
    font-family: var(--font-family);
    line-height: var(--line-height-tight);
}

/* Primary Button */
.btn-primary {
    background: var(--gradient-primary);
    color: var(--color-text-white);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

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

/* Secondary Button */
.btn-secondary {
    background-color: var(--color-bg-light);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border-light);
}

.btn-secondary:hover {
    background-color: #e8f0f8;
    border-color: var(--color-border);
}

.btn-secondary:active {
    background-color: #dce8f4;
}

/* Outline Button */
.btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: var(--color-text-white);
}

/* Danger Button */
.btn-danger {
    background-color: var(--color-error);
    color: var(--color-text-white);
}

.btn-danger:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-md);
}

/* Success Button */
.btn-success {
    background-color: var(--color-success);
    color: var(--color-text-white);
}

.btn-success:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-md);
}

/* Warning Button */
.btn-warning {
    background-color: var(--color-warning);
    color: #333;
}

.btn-warning:hover {
    opacity: 0.9;
}

/* Button Sizes */
.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-lg {
    padding: 16px 40px;
    font-size: 16px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Button with Icon */
.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   2. FORMS & INPUTS
   ========================================================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group.required label::after {
    content: ' *';
    color: var(--color-error);
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-dark);
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    color: var(--color-text-default);
    background-color: var(--color-bg-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    transition: var(--transition-default);
}

.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(224, 53, 160, 0.1);
    background-color: var(--color-bg-white);
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--color-text-hint);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
    cursor: pointer;
}

/* Form Validation States */
.form-control.is-invalid,
input.is-invalid {
    border-color: var(--color-error);
}

.form-control.is-invalid:focus,
input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-control.is-valid,
input.is-valid {
    border-color: var(--color-success);
}

.form-control.is-valid:focus,
input.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Form Help Text */
.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.form-text.text-error {
    color: var(--color-error);
}

.form-text.text-success {
    color: var(--color-success);
}

/* Checkboxes & Radios */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.form-check-input {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    margin-top: 0;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.form-check-label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: var(--font-weight-regular);
}

/* Form Row */
.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

/* ==========================================================================
   3. CARDS
   ========================================================================== */

.card {
    background-color: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-default);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.card-header {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.card-header h3,
.card-header h4 {
    margin-bottom: 0;
}

.card-body {
    padding: 0;
}

.card-footer {
    border-top: 1px solid var(--color-border);
    padding-top: 15px;
    margin-top: 15px;
}

/* Card Variants */
.card-primary {
    border-left: 4px solid var(--color-primary);
}

.card-success {
    border-left: 4px solid var(--color-success);
}

.card-error {
    border-left: 4px solid var(--color-error);
}

.card-warning {
    border-left: 4px solid var(--color-warning);
}

/* ==========================================================================
   4. NAVIGATION
   ========================================================================== */

.navbar {
    background-color: transparent;
    padding: 15px 0;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    transition: var(--transition-default);
}

.navbar.scrolled {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-md);
    padding: 10px 0;
}

.navbar-brand {
    display: inline-block;
    font-size: 20px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-heading);
    text-decoration: none;
    margin-right: 30px;
}

.navbar.scrolled .navbar-brand {
    color: var(--color-text-white);
}

.nav {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    text-transform: capitalize;
    text-decoration: none;
    transition: var(--transition-default);
    padding: 8px 12px;
    border-radius: var(--radius-md);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-text-white);
    background-color: rgba(255, 255, 255, 0.1);
}

/* Sidebar */
.sidebar {
    background-color: var(--color-bg-light);
    padding: 20px;
    border-right: 1px solid var(--color-border);
    height: calc(100vh - 80px);
    overflow-y: auto;
    position: sticky;
    top: 80px;
}

.sidebar-item {
    display: block;
    padding: 12px 15px;
    margin-bottom: 8px;
    color: var(--color-text-default);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-default);
}

.sidebar-item:hover,
.sidebar-item.active {
    background-color: #e8f0f8;
    color: var(--color-primary);
}

.sidebar-item.active {
    border-left: 3px solid var(--color-primary);
    padding-left: 12px;
}

/* ==========================================================================
   5. MODALS & DIALOGS
   ========================================================================== */

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

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--color-bg-white);
    padding: 30px;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

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

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

.modal-title {
    font-size: 20px;
    color: var(--color-text-heading);
    font-weight: var(--font-weight-bold);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0;
}

.modal-close:hover {
    color: var(--color-text-heading);
}

.modal-body {
    margin-bottom: 20px;
}

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

/* ==========================================================================
   6. ALERTS & MESSAGES
   ========================================================================== */

.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 15px;
}

.alert-success {
    background-color: #d4edda;
    border-left-color: var(--color-success);
    color: #155724;
}

.alert-error,
.alert-danger {
    background-color: #f8d7da;
    border-left-color: var(--color-error);
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-left-color: var(--color-warning);
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-left-color: var(--color-info);
    color: #0c5460;
}

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: inherit;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

/* ==========================================================================
   7. BADGES & TAGS
   ========================================================================== */

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

.badge-success {
    background-color: #d4edda;
    color: var(--color-success);
}

.badge-error {
    background-color: #f8d7da;
    color: var(--color-error);
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-info {
    background-color: #d1ecf1;
    color: var(--color-info);
}

.badge-secondary {
    background-color: var(--color-bg-light);
    color: var(--color-text-muted);
}

/* ==========================================================================
   8. TABLES
   ========================================================================== */

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table thead th {
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    padding: 12px;
    text-align: left;
    font-weight: var(--font-weight-semibold);
    border-bottom: 2px solid var(--color-border);
}

.table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--color-border);
}

.table tbody tr:hover {
    background-color: var(--color-bg-light);
}

.table tbody tr:nth-child(even) {
    background-color: var(--color-bg-light);
}

.table-sm th,
.table-sm td {
    padding: 8px;
    font-size: 12px;
}

/* ==========================================================================
   9. LOADERS & SPINNERS
   ========================================================================== */

.spinner {
    display: inline-block;
    border: 3px solid rgba(224, 53, 160, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
}

.spinner-md {
    width: 40px;
    height: 40px;
}

.spinner-lg {
    width: 60px;
    height: 60px;
}

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

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: var(--color-text-muted);
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-bg-light) 25%,
        #f0f0f0 50%,
        var(--color-bg-light) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 10px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==========================================================================
   End of components.css
   ========================================================================== */
