:root {
    --primary-color: #00635a;
    --secondary-color: #004a43;
    --background-color: #008080;
    --text-color: #333;
    --card-bg: #ffffff;
    --border-color: #ced4da;
}

[data-theme="dark"] {
    --primary-color: #00a896;
    --secondary-color: #00897b;
    --background-color: #008080;
    --text-color: #f8f9fa;
    --card-bg: #2d2d2d;
    --border-color: #404040;
    --table-text: #ffffff;
    --input-text: #ffffff;
    --modal-text: #ffffff;
    --schedule-bg: #3d3d3d;
    --matricula-bg: #3d3d3d;
    --especialidad-bg: #3d3d3d;
    --placeholder-color: #a0a0a0;
    --grid-bg: #2d2d2d;
    --grid-row-hover: #3d3d3d;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.search-container, .grid-container {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    width: 100%;
    height: 400px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.form-control, .form-select {
    border: 1px solid var(--border-color);
    padding: 0.40rem;
    border-radius: 10px;
    background-color: var(--card-bg);
    color: var(--input-text);
    transition: all 0.3s ease;
}

.form-control::placeholder {
    color: var(--placeholder-color);
}

.form-select option {
    background-color: var(--card-bg);
    color: var(--input-text);
}

.form-select:focus, .form-control:focus {
    background-color: var(--card-bg);
    color: var(--input-text);
}

.input-group-text {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--input-text);
}

.fa-user-md{
    padding: 0.20rem;
}

.search-btn {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.15rem 1rem;
    border-radius: 3px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-1px);
}

.grid-container.animate {
    animation: fadeIn 0.5s ease-out forwards;
}

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

.results-scroll {
    overflow-y: auto;
    height: 100%;
    min-height: 200px;
    width: 100%;
    background-color: var(--grid-bg);
}

.table {
    margin-bottom: 0;
    width: 100%;
    font-size: 1.1rem;
    table-layout: fixed;
    border-collapse: collapse;
    color: var(--table-text);
    background-color: var(--grid-bg);
}

.table th {
    background-color: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    border-bottom: 2px solid #b8bbbf;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table td {
    padding: 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    background-color: var(--grid-bg);
}

.table th:first-child,
.table td:first-child {
    width: 50px;
}

.table th:nth-child(2),
.table td:nth-child(2) {
    width: calc(100% - 50px);
}

.table tr:hover td {
    background-color: var(--grid-row-hover);
}

.doctor-icon {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.results-count {
    background-color: white;
    border-radius: 8px;
    padding: 0.50rem;
    margin-top: 2rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .search-container, .grid-container {
        margin-top: 1rem;
        padding: 0.8rem;
        height: auto;
        min-height: 400px;
    }
    
    .results-scroll {
        height: auto;
        max-height: 500px;
    }
}

.form-label2 {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
    color: #333;
    box-shadow: 0 2px 15px rgba(0,0,0,0.2);
}

.form-label3 {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: #333;
    font-weight: bold;
}

.doctor-name {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    text-align: center;
    font-size: 0.9rem;
    word-wrap: break-word;
    white-space: normal;
}

.doctor-name:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.modal-content {
    background-color: var(--card-bg);
    color: var(--modal-text);
    border-radius: 15px;
    border: none;
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
    border-radius: 15px 15px 0 0;
}

.btn-close {
    filter: brightness(0) invert(1);
    opacity: 1;
}

.btn-close:hover {
    opacity: 0.8;
}

.modal-body {
    padding: 20px;
}

.doctor-details {
    font-size: 1.1rem;
}

.doctor-details p {
    margin-bottom: 5px;
    color: var(--text-color);
}

.doctor-details i {
    color: var(--primary-color);
    margin-right: 10px;
    width: 20px;
}

.schedule-container, .matricula-container, .especialidad-container {
    background-color: var(--schedule-bg);
    border-radius: 8px;
    padding: 8px;
    margin: 8px 0;
    font-size: 0.9rem;
    color: var(--text-color);
}

.schedule-day {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-color);
}

.schedule-day strong {
    min-width: 100px;
    color: var(--primary-color);
    color: var(--text-color);
}

.doctor-name-display {
    font-size: 0.80rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: bold;
    text-align: center;
    padding: 10px;
    background-color: var(--schedule-bg);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.doctor-name-display i {
    font-size: 1.8rem;
    margin-right: 15px;
    vertical-align: middle;
}

.doctor-name-display span {
    vertical-align: middle;
}

.social-icons-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
}

.social-icon {
    width: 30px;
    height: 30px;
    padding: 3px;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.1);
}

.facebook-icon {
    background: #1877F2;
}

.instagram-icon {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.social-icon svg {
    width: 100%;
    height: 100%;
}

.social-icon svg path {
    fill: white;
}

.theme-toggle {
    position: fixed;
    top: 205px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
    background-color: var(--secondary-color);
}

.theme-toggle i {
    font-size: 1.2rem;
    color: white;
}

.theme-toggle span {
    font-size: 0.9rem;
    color: white;
    font-weight: 500;
}

[data-theme="dark"] .theme-toggle {
    background-color: var(--primary-color);
    border: none;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    gap: 10px;
}

.header-container h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

@media (max-width: 576px) {
    .theme-toggle {
        position: static;
        margin: 0 auto 1rem auto;
        display: flex;
        justify-content: center;
        width: fit-content;
    }
    .theme-toggle i {
        font-size: 1rem;
    }
    .theme-toggle span {
        font-size: 0.8rem;
    }
}

.search-container, .grid-container {
    padding: 0.75rem;
}

.form-control, .form-select {
    font-size: 0.9rem;
}

.btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}
}

*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}