/*
 * structure.css
 * Contains layout properties and component structures
 */

/* Base typography */
body {
    font-family: var(--font-family-sans-serif);
    font-size: 0.95rem;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.squared {
    border-radius: 0px !important;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-family-headings);
    font-weight: 600;
}

.content {
    flex: 1;
}

.footer {
    margin-top: auto;
}

/* Common font variables */
:root {
    --font-family-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-headings: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Layout components */
.container-fluid, .container {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Card structures */
.card {
    border-radius: 8px !important;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-header {
    background-color: var(--bg-light);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem;
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem;
}

/* Stats cards */
.stats-card {
    border-left: 4px solid var(--stats-card-border);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 24px;
    background-color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stats-card:hover {

    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.05) 0%, rgba(var(--primary-color-rgb), 0) 60%);
    z-index: 0;
}

.stats-card .value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.stats-card .label {
    text-transform: uppercase;
    color: var(--secondary-color);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Feature cards */
.feature-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    height: 100%;
}



.feature-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Anamnesis cards */
.anamnesis-card {
    border-left: 4px solid var(--anamnesis-card-border);
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin-bottom: 20px;
}

.anamnesis-card .patient-name {
    font-size: 1.2rem;
    font-weight: bold;
}

.anamnesis-card .patient-id {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.anamnesis-card .date {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Note cards */
.note-card {
    border-left: 3px solid var(--note-card-border);
    padding: 10px 15px;
    margin-bottom: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.note-card .user {
    font-weight: bold;
}

.note-card .date {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

/* Form elements */
.form-control,
.form-select {
    border-radius: 6px;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(var(--primary-color-rgb), 0.5);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.15);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.form-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.input-group .btn {
    z-index: 0;
}

.form-floating > .form-control,
.form-floating > .form-select {
    height: calc(3.5rem + 2px);
    padding: 1rem 0.75rem;
}

.form-floating > label {
    padding: 1rem 0.75rem;
}

/* Button structures */
.btn {
    border-radius: 0px !important;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.4s, opacity 0.8s;
}

.btn:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    box-shadow: 0 4px 10px rgba(var(--primary-color-rgb), 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 15px rgba(var(--primary-color-rgb), 0.4);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
    width: 2.5rem;
    border-radius: 50% !important;
    padding: 0;
}

.btn-icon-sm {
    height: 2rem;
    width: 2rem;
}

/* Navbar structure */
.navbar-enhanced {
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.navbar-enhanced .navbar-brand {
    font-weight: 700;
    padding: 0.5rem 0;
}

.navbar-enhanced .nav-item {
    margin: 0 0.15rem;
}

.navbar-enhanced .nav-link {
    font-weight: 500;
    padding: 0.5rem 0.85rem;
    border-radius: 4px;
}

/* Hero section */
.hero {
    margin-top: 0px;
    background-size: cover;
    background-position: top;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 2rem;
}

/* Form builder styles */
.form-builder-section {
    background-color: var(--light-color);
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-field-card {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: white;
}

.form-preview {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    background-color: white;
}

/* Auth pages */
.auth-card {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.auth-divider {
    margin: 20px 0;
    position: relative;
    text-align: center;
}

.auth-divider:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #ddd;
    z-index: -1;
}

.auth-divider span {
    background-color: white;
    padding: 0 10px;
    color: var(--secondary-color);
}

/* Utility classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hover-shadow {
    transition: all 0.3s ease;
}

/* Spacing utilities */
.mt-9 {
    margin-top: 90px;
}

/* Status indicator */
.status-indicator {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    margin-right: 0.5rem;
}

/* Form list item */
.form-list-item-wrapper {
    display: flex;
    gap: -0.1rem;
    overflow: hidden;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.form-list-item-wrapper:hover {
    transform: translateX(3px);
}

.generate-link-icon {
    width: 48px;
    min-height: 100%;
    display: flex;
    align-items: stretch;
    color: #dee2e6;
}

.generate-link-icon .icon-only {
    width: 100%;
    height: 100%;
    text-decoration: none;
    border: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    padding: 0;
    color: var(--primary-color);
    transition: all 0.2s ease;
    background-color: rgba(var(--primary-color-rgb), 0.02);
    border-radius: 4px 0 0 4px;
}

.generate-link-icon .icon-only:hover {
    background-color: rgba(var(--primary-color-rgb), 0.1);
}

.list-group-item {
    border-radius: 0 4px 4px 0 !important;
    transition: all 0.2s ease;
    border-left: none;
}

.list-group-item:hover {
    background-color: rgba(var(--primary-color-rgb), 0.03);
}

/* Testimonial components */
.testimonial-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
}

.step-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Table styling */
.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    border-bottom: 2px solid var(--border-color);
    background-color: white;
    color: var(--dark-color);
    font-weight: 600;
    padding: 1rem 0.75rem;
    font-size: 0.85rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.table thead th:first-child {
    border-top-left-radius: 2px;
    width: 30%
}

.table thead th:last-child {
    border-top-right-radius: 2px;
}

.table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 0px solid transparent !important;
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table-hover tbody tr:hover {
    background-color: rgba(var(--primary-color-rgb), 0.04);

}

.table tbody td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-top: 1px solid var(--border-color);
}

/* Zebra striping for better readability */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Enhanced list pages */
.list-page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(var(--primary-color-rgb), 0.1);
}

.list-container {
    position: relative;
}

.list-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(var(--primary-color-rgb), 0.03) 0%, rgba(var(--primary-color-rgb), 0) 100%);
    z-index: -1;
    border-radius: 12px 12px 0 0;
}

/* Enhanced table elements */
.table-status {
    width: 85px;
    text-align: center;
}

.table-actions {
    width: 180px;
    text-align: right;
}

.table-date,
.table-count {
    width: 220px;
}

/* Table empty state */
.table-empty-state {
    padding: 3rem 0;
    text-align: center;
    background-color: rgba(var(--primary-color-rgb), 0.01);
    border-radius: 8px;
}

.table-empty-state i {
    font-size: 1rem;
    color: white;

}

.table-empty-state .lead {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Data count footer */
.data-count-footer {
    padding: 1rem 1.5rem;
    background-color: rgba(var(--primary-color-rgb), 0.02);
    border-top: 1px solid rgba(var(--primary-color-rgb), 0.05);
    border-radius: 0 0 8px 8px;
    font-size: 0.9rem;
}

/* Badge styling */
.badge {
    padding: 0.5em 0.85em;
    font-weight: 500;
    letter-spacing: 0.5px;
    border-radius: 4px;
}

/* Mobile Responsiveness Utilities */
@media (max-width: 768px) {
    /* Touch targets - minimum 44px */
    .btn, .btn-sm, .btn-lg {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .btn-icon, .btn-icon-sm {
        min-height: 44px;
        min-width: 44px;
    }

    /* Form elements */
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px;
    }

    /* Navigation improvements */
    .navbar-enhanced .navbar-collapse {
        background-color: inherit;
        border-radius: 6px;
        padding: 1rem;
        margin-top: 0.5rem;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    }

    .navbar-enhanced .nav-action {
        margin: 0.5rem 0 0 0;
    }

    /* Table responsiveness */
    .table-responsive {
        border-radius: 8px;
        overflow: hidden;
        font-size: 14px;
    }

    .table th, .table td {
        padding: 8px 4px;
        white-space: nowrap;
    }

    /* Hide non-essential columns on mobile */
    .table-mobile-hide {
        display: none;
    }

    /* Hero sections */
    .hero-section {
        padding: 50px 0;
        min-height: auto;
    }

    /* Stats cards */
    .stats-card {
        margin-bottom: 15px;
    }

    /* Grid improvements */
    .row {
        --bs-gutter-x: 1rem;
    }

    /* Card spacing */
    .card {
        margin-bottom: 1rem;
    }

    /* Modal improvements */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: 12px;
    }

    /* Container adjustments */
    .container, .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Typography scaling */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }

    /* List improvements */
    .list-group-item {
        padding: 12px 16px;
    }

    /* Badge improvements */
    .badge {
        font-size: 12px;
        padding: 6px 8px;
    }

    /* Alert improvements */
    .alert {
        padding: 12px 16px;
        font-size: 14px;
    }

    /* Input group improvements */
    .input-group .btn {
        min-height: 44px;
    }

    /* Dropdown improvements */
    .dropdown-menu {
        font-size: 14px;
    }

    .dropdown-item {
        padding: 12px 16px;
    }

    /* Form field improvements for mobile */
    .row .col-6 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* Specific form field fixes */
    .form-control, .form-select {
        width: 100% !important;
    }
}

/* Tablet adjustments */
@media (max-width: 992px) and (min-width: 769px) {
    .container, .container-fluid {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .btn {
        min-height: 40px;
        padding: 10px 14px;
    }

    .form-control, .form-select {
        min-height: 40px;
    }
}

/* Large mobile improvements */
@media (max-width: 480px) {
    .container, .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .btn {
        width: 100%;
        margin-bottom: 8px;
    }

    .card {
        border-radius: 8px;
    }

    .table th, .table td {
        padding: 6px 3px;
        font-size: 12px;
    }

    .stats-card .value {
        font-size: 1.5rem;
    }

    .badge {
        font-size: 11px;
        padding: 4px 6px;
    }
}
