/**
 * Programări Medicale - CSS Principal
 * Versiune: 1.0.0
 */

/* Reset și variabile */
:root {
    --pm-primary-color: #007cba;
    --pm-secondary-color: #005a87;
    --pm-success-color: #28a745;
    --pm-warning-color: #ffc107;
    --pm-danger-color: #dc3545;
    --pm-light-color: #f8f9fa;
    --pm-dark-color: #343a40;
    --pm-border-color: #e0e0e0;
    --pm-text-color: #333;
    --pm-text-muted: #666;
    --pm-border-radius: 8px;
    --pm-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    --pm-transition: all 0.3s ease;
}

/* Stiluri generale */
.pm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.pm-section {
    margin-bottom: 40px;
}

.pm-section-title {
    font-size: 2em;
    color: var(--pm-text-color);
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.pm-section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--pm-primary-color);
    border-radius: 2px;
}

/* Butoane */
.pm-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--pm-border-radius);
    text-decoration: none;
    text-align: center;
    font-weight: 500;
    cursor: pointer;
    transition: var(--pm-transition);
    font-size: 14px;
    line-height: 1.4;
}

.pm-btn-primary {
    background: var(--pm-primary-color);
    color: white;
}

.pm-btn-primary:hover {
    background: var(--pm-secondary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.pm-btn-secondary {
    background: var(--pm-light-color);
    color: var(--pm-text-color);
    border: 1px solid var(--pm-border-color);
}

.pm-btn-secondary:hover {
    background: #e9ecef;
    color: var(--pm-text-color);
}

.pm-btn-success {
    background: var(--pm-success-color);
    color: white;
}

.pm-btn-success:hover {
    background: #218838;
    color: white;
}

.pm-btn-danger {
    background: var(--pm-danger-color);
    color: white;
}

.pm-btn-danger:hover {
    background: #c82333;
    color: white;
}

.pm-btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.pm-btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* Carduri */
.pm-card {
    background: white;
    border: 1px solid var(--pm-border-color);
    border-radius: var(--pm-border-radius);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--pm-box-shadow);
    transition: var(--pm-transition);
}

.pm-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.pm-card-header {
    border-bottom: 1px solid var(--pm-border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.pm-card-title {
    font-size: 1.3em;
    color: var(--pm-text-color);
    margin: 0;
    font-weight: 600;
}

.pm-card-body {
    color: var(--pm-text-muted);
    line-height: 1.6;
}

/* Formulare */
.pm-form {
    background: white;
    padding: 30px;
    border-radius: var(--pm-border-radius);
    box-shadow: var(--pm-box-shadow);
}

.pm-form-group {
    margin-bottom: 20px;
}

.pm-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--pm-text-color);
}

.pm-form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--pm-border-color);
    border-radius: var(--pm-border-radius);
    font-size: 14px;
    transition: var(--pm-transition);
    box-sizing: border-box;
}

.pm-form-control:focus {
    outline: none;
    border-color: var(--pm-primary-color);
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.pm-form-control.error {
    border-color: var(--pm-danger-color);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.pm-form-error {
    color: var(--pm-danger-color);
    font-size: 12px;
    margin-top: 5px;
}

.pm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Grid și layout */
.pm-grid {
    display: grid;
    gap: 20px;
}

.pm-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.pm-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.pm-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Status badges */
.pm-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pm-status-scheduled {
    background: #e3f2fd;
    color: #1976d2;
}

.pm-status-confirmed {
    background: #e8f5e8;
    color: #2e7d32;
}

.pm-status-completed {
    background: #f3e5f5;
    color: #7b1fa2;
}

.pm-status-cancelled {
    background: #ffebee;
    color: #c62828;
}

/* Tabele */
.pm-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--pm-border-radius);
    overflow: hidden;
    box-shadow: var(--pm-box-shadow);
}

.pm-table th,
.pm-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--pm-border-color);
}

.pm-table th {
    background: var(--pm-light-color);
    font-weight: 600;
    color: var(--pm-text-color);
}

.pm-table tr:hover {
    background: #f8f9fa;
}

/* Alert-uri */
.pm-alert {
    padding: 15px 20px;
    border-radius: var(--pm-border-radius);
    margin-bottom: 20px;
    border-left: 4px solid;
}

.pm-alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: var(--pm-success-color);
}

.pm-alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: var(--pm-warning-color);
}

.pm-alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left-color: var(--pm-danger-color);
}

.pm-alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--pm-primary-color);
}

/* Loading spinner */
.pm-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--pm-primary-color);
    border-radius: 50%;
    animation: pm-spin 1s linear infinite;
}

@keyframes pm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Calendar */
.pm-calendar {
    background: white;
    border-radius: var(--pm-border-radius);
    box-shadow: var(--pm-box-shadow);
    overflow: hidden;
}

.pm-calendar-header {
    background: var(--pm-primary-color);
    color: white;
    padding: 20px;
    text-align: center;
}

.pm-calendar-title {
    font-size: 1.5em;
    margin: 0;
}

.pm-calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.pm-calendar-nav-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: var(--pm-transition);
}

.pm-calendar-nav-btn:hover {
    background: rgba(255,255,255,0.2);
}

.pm-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.pm-calendar-day-header {
    background: var(--pm-light-color);
    padding: 10px;
    text-align: center;
    font-weight: 600;
    border-bottom: 1px solid var(--pm-border-color);
}

.pm-calendar-day {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid var(--pm-border-color);
    border-right: 1px solid var(--pm-border-color);
    min-height: 80px;
    cursor: pointer;
    transition: var(--pm-transition);
}

.pm-calendar-day:hover {
    background: #f8f9fa;
}

.pm-calendar-day.today {
    background: var(--pm-primary-color);
    color: white;
}

.pm-calendar-day.has-appointments {
    background: #e8f5e8;
    font-weight: 600;
}

.pm-calendar-day.other-month {
    color: #ccc;
}

/* Responsive */
@media (max-width: 768px) {
    .pm-container {
        padding: 15px;
    }
    
    .pm-form-row {
        grid-template-columns: 1fr;
    }
    
    .pm-grid-2,
    .pm-grid-3,
    .pm-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .pm-table {
        font-size: 14px;
    }
    
    .pm-table th,
    .pm-table td {
        padding: 10px;
    }
    
    .pm-calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        font-size: 12px;
    }
    
    .pm-calendar-day {
        padding: 5px;
        min-height: 60px;
    }
}

@media (max-width: 480px) {
    .pm-section-title {
        font-size: 1.5em;
    }
    
    .pm-card {
        padding: 20px;
    }
    
    .pm-form {
        padding: 20px;
    }
    
    .pm-btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Animații */
.pm-fade-in {
    animation: pm-fade-in 0.5s ease-in;
}

@keyframes pm-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pm-slide-in {
    animation: pm-slide-in 0.3s ease-out;
}

@keyframes pm-slide-in {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Utilitare */
.pm-text-center {
    text-align: center;
}

.pm-text-right {
    text-align: right;
}

.pm-text-left {
    text-align: left;
}

.pm-mb-0 { margin-bottom: 0; }
.pm-mb-1 { margin-bottom: 10px; }
.pm-mb-2 { margin-bottom: 20px; }
.pm-mb-3 { margin-bottom: 30px; }

.pm-mt-0 { margin-top: 0; }
.pm-mt-1 { margin-top: 10px; }
.pm-mt-2 { margin-top: 20px; }
.pm-mt-3 { margin-top: 30px; }

.pm-p-0 { padding: 0; }
.pm-p-1 { padding: 10px; }
.pm-p-2 { padding: 20px; }
.pm-p-3 { padding: 30px; }

.pm-hidden {
    display: none;
}

.pm-visible {
    display: block;
}

/* Print styles */
@media print {
    .pm-btn,
    .pm-calendar-nav {
        display: none;
    }
    
    .pm-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Two Column Layout pentru Admin Pages */
.wrap .two-column-layout {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px !important;
    margin-bottom: 20px !important;
}

.wrap .two-column-layout .card {
    flex: 1 1 calc(50% - 10px) !important;
    min-width: 300px !important;
    margin-bottom: 0 !important;
}

.wrap .two-column-layout .card h2 {
    font-size: 1.2em !important;
    margin-bottom: 15px !important;
}

.wrap .two-column-layout .card p {
    font-size: 0.9em !important;
    margin-bottom: 15px !important;
}

.wrap .two-column-layout table {
    font-size: 0.85em !important;
}

.wrap .two-column-layout table th,
.wrap .two-column-layout table td {
    padding: 8px 6px !important;
}

/* Responsive pentru layout-ul cu două coloane */
@media (max-width: 1200px) {
    .wrap .two-column-layout .card {
        flex: 1 1 100% !important;
        margin-bottom: 15px !important;
    }
}

@media (max-width: 768px) {
    .wrap .two-column-layout {
        gap: 10px !important;
    }
    
    .wrap .two-column-layout .card {
        padding: 15px !important;
    }
    
    .wrap .two-column-layout .card h2 {
        font-size: 1.1em !important;
    }
    
    .wrap .two-column-layout table {
        font-size: 0.8em !important;
    }
    
    .wrap .two-column-layout table th,
    .wrap .two-column-layout table td {
        padding: 6px 4px !important;
    }
}

/* CNP Display Styles */
.cnp-display {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    background: #f0f0f0;
    border: 1px solid #ddd;
}

.cnp-display.cnp-foreign {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.cnp-display.cnp-special {
    background: #ffe6e6;
    border-color: #ffb3b3;
    color: #721c24;
}

.cnp-display small {
    font-size: 10px;
    font-weight: normal;
    display: block;
    margin-top: 2px;
}

/* CNP Types Table */
.pm-cnp-types table {
    margin-bottom: 20px;
}

.pm-cnp-types th {
    background: #f8f9fa;
    font-weight: 600;
}

.pm-cnp-notes {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #007cba;
}

.pm-cnp-notes h4 {
    margin-top: 0;
    color: #007cba;
}

.pm-cnp-notes ul {
    margin-bottom: 0;
}

.pm-cnp-notes li {
    margin-bottom: 5px;
}

/* Exemple CNP */
.pm-cnp-examples {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.pm-cnp-examples h4 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.pm-example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.pm-example-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #0073aa;
}

.pm-example-item h5 {
    margin-top: 0;
    color: #0073aa;
    font-size: 16px;
    font-weight: 600;
}

.cnp-display {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    padding: 10px 15px;
    background: #e8f5e8;
    border: 2px solid #4caf50;
    border-radius: 6px;
    text-align: center;
    margin: 15px 0;
    position: relative;
    color: #2e7d32;
}

.cnp-display.cnp-foreign {
    background: #fff3e0;
    border-color: #ff9800;
    color: #e65100;
}

.cnp-display.cnp-special {
    background: #fce4ec;
    border-color: #e91e63;
    color: #c2185b;
}

.cnp-display small {
    display: block;
    font-size: 12px;
    font-weight: normal;
    margin-top: 5px;
    opacity: 0.8;
}

.pm-example-details {
    margin-top: 15px;
}

.pm-example-details p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.4;
}

.pm-example-details strong {
    color: #555;
    min-width: 120px;
    display: inline-block;
}

.pm-example-legend {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.pm-example-legend h5 {
    margin-top: 0;
    color: #333;
    font-size: 14px;
    margin-bottom: 15px;
}

.pm-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.pm-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pm-legend-item .cnp-display {
    font-size: 14px;
    padding: 5px 10px;
    margin: 0;
    min-width: 120px;
    text-align: center;
}

.pm-legend-text {
    font-size: 13px;
    color: #666;
}

/* Responsive pentru exemple */
@media (max-width: 768px) {
    .pm-example-grid {
        grid-template-columns: 1fr;
    }
    
    .pm-legend-items {
        flex-direction: column;
        gap: 10px;
    }
    
    .pm-legend-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Stiluri pentru pagina de import */
.pm-import-instructions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #0073aa;
}

.pm-import-instructions h3 {
    margin-top: 0;
    color: #0073aa;
}

.pm-import-instructions ul {
    margin: 15px 0;
}

.pm-import-instructions li {
    margin: 8px 0;
    line-height: 1.5;
}

.pm-import-instructions strong {
    color: #333;
    min-width: 100px;
    display: inline-block;
}

.pm-csv-example {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.pm-csv-example h4 {
    margin-top: 0;
    color: #555;
    font-size: 16px;
}

.pm-example-csv {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
}

.pm-example-csv code {
    display: block;
    margin: 5px 0;
    color: #333;
}

.pm-import-notes {
    margin-top: 25px;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
}

.pm-import-notes h5 {
    margin-top: 0;
    color: #856404;
    font-size: 16px;
}

.pm-import-notes ul {
    margin: 15px 0;
    color: #856404;
}

.pm-import-notes li {
    margin: 8px 0;
    line-height: 1.4;
}

/* Stiluri pentru pagina de exemple CNP */
.pm-cnp-intro {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #2196f3;
}

.pm-cnp-intro p {
    margin: 0;
    font-size: 16px;
    color: #1976d2;
}

.pm-cnp-structure {
    margin-bottom: 40px;
}

.pm-cnp-structure h2 {
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.pm-structure-diagram {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.pm-cnp-parts {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.pm-part {
    text-align: center;
    flex: 1;
    min-width: 120px;
    padding: 15px 10px;
    background: white;
    border-radius: 6px;
    border: 2px solid #0073aa;
    position: relative;
}

.pm-part::after {
    content: '→';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #0073aa;
    font-weight: bold;
}

.pm-part:last-child::after {
    display: none;
}

.pm-part-label {
    display: block;
    font-weight: bold;
    color: #0073aa;
    font-size: 14px;
    margin-bottom: 5px;
}

.pm-part-desc {
    display: block;
    font-size: 12px;
    color: #666;
}

.pm-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.pm-detail-row:last-child {
    border-bottom: none;
}

.pm-detail-label {
    font-weight: 600;
    color: #555;
    min-width: 120px;
}

.pm-detail-value {
    color: #333;
    text-align: right;
    flex: 1;
}

.pm-important-notes {
    margin-top: 40px;
    padding: 25px;
    background: #fff3e0;
    border: 1px solid #ffb74d;
    border-radius: 8px;
}

.pm-important-notes h3 {
    margin-top: 0;
    color: #e65100;
    border-bottom: 2px solid #ff9800;
    padding-bottom: 10px;
}

.pm-notes-content ul {
    margin: 15px 0;
    color: #e65100;
}

.pm-notes-content li {
    margin: 12px 0;
    line-height: 1.6;
}

.pm-notes-content strong {
    color: #bf360c;
}

/* Responsive pentru pagina de exemple CNP */
@media (max-width: 768px) {
    .pm-cnp-parts {
        flex-direction: column;
        gap: 10px;
    }
    
    .pm-part {
        width: 100%;
        min-width: auto;
    }
    
    .pm-part::after {
        content: '↓';
        right: 50%;
        top: auto;
        bottom: -20px;
        transform: translateX(50%);
    }
    
    .pm-part:last-child::after {
        display: none;
    }
    
    .pm-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .pm-detail-value {
        text-align: left;
    }
}

/* Stiluri pentru link-uri către exemple CNP */
.pm-cnp-link {
    margin-top: 25px;
    padding: 20px;
    background: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 8px;
    text-align: center;
}

.pm-cnp-link p {
    margin: 0;
    font-size: 16px;
    color: #2e7d32;
}

.pm-cnp-link .button {
    margin-left: 10px;
    background: #4caf50;
    border-color: #4caf50;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
}

.pm-cnp-link .button:hover {
    background: #45a049;
    border-color: #45a049;
}

/* Flatpickr custom pentru programari-medicale */
.flatpickr-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1em;
    background: #fff;
    color: #333;
}

.flatpickr-calendar {
    font-family: inherit;
    z-index: 9999;
}

.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange, .flatpickr-day:hover {
    background: #007cba;
    color: #fff;
    border-radius: 6px;
}

.flatpickr-months .flatpickr-month {
    background: #f8f9fa;
    color: #007cba;
    border-radius: 6px 6px 0 0;
}

.flatpickr-weekday {
    color: #007cba;
    font-weight: 600;
} 