/* Custom styles for Proceduri Operationale Platform */

/* Root variables */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* Body and general styles */
body {
    background-color: #f5f5f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
header {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-title {
    font-weight: 600;
}

/* Navigation styles */
.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.dropdown-item {
    font-weight: 500;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Card styles */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

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

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

/* Button styles */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

/* Table styles */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table {
    background-color: #fff;
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
}

.table tbody tr {
    transition: all 0.3s ease;
}

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

.table tbody td {
    border-color: #dee2e6;
    vertical-align: middle;
    padding: 0.75rem;
}

/* Form styles */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

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

/* Badge styles */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
}

/* Alert styles */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Dashboard stats cards */
.stats-card {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    border-radius: 12px;
    transition: all 0.3s ease;
    color: white;
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.stats-card .card-body {
    padding: 2rem 1.5rem;
}

.stats-card h4 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stats-card h6 {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
}

/* Quick actions */
.quick-action-btn {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border: 2px solid #dee2e6;
    color: var(--dark-color);
    transition: all 0.3s ease;
}

.quick-action-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.3);
}

/* Footer styles */
footer {
    margin-top: auto;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

/* Breadcrumb styles */
.breadcrumb {
    background-color: transparent;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* Tab styles */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--secondary-color);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom: 3px solid var(--primary-color);
}

.tab-content {
    padding: 1.5rem 0;
}

/* Inline editable table styles */
.inline-editable-table {
    margin-top: 1rem;
}

.inline-editable-table td[contenteditable="true"] {
    background-color: #fffbf0;
    cursor: text;
    min-width: 100px;
}

.inline-editable-table td[contenteditable="true"]:hover {
    background-color: #fff9e6;
}

.inline-editable-table td[contenteditable="true"]:focus {
    outline: 2px solid var(--primary-color);
    background-color: #fff;
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

/* Login page styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
}

.login-card {
    max-width: 600px;
    width: 100%;
}

/* Print styles */
@media print {
    header,
    nav,
    footer,
    .btn,
    .breadcrumb,
    .card-header .btn {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .table {
        box-shadow: none !important;
    }

    body {
        background-color: white;
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    header {
        padding: 0.75rem 0 !important;
    }

    .header-title {
        font-size: 1.1rem;
    }

    .stats-card .card-body {
        padding: 1rem;
        text-align: center;
    }

    .stats-card h4 {
        font-size: 1.8rem;
    }

    .stats-card h6 {
        font-size: 0.8rem;
    }

    /* Mobile table view */
    .table-responsive {
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        padding: 0.5rem;
    }

    .table thead {
        display: none;
    }

    .table tbody {
        display: block;
    }

    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        padding: 1rem;
        background: #ffffff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
        border-left: 4px solid transparent;
        border-radius: 8px;
    }

    .table tbody tr:hover {
        border-left-color: var(--primary-color);
        box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
    }

    .table tbody td {
        display: block;
        border: none;
        padding: 0.5rem 0;
        text-align: left;
        position: relative;
        padding-left: 45%;
    }

    .table tbody td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        font-weight: 600;
        color: #495057;
        text-transform: uppercase;
        font-size: 0.7rem;
        letter-spacing: 0.5px;
    }

    .table tbody td:last-child {
        padding-left: 0;
        text-align: center;
        border-top: 1px solid #dee2e6;
        padding-top: 1rem;
        margin-top: 0.5rem;
    }

    .table tbody td:last-child:before {
        display: none;
    }

    /* Mobile button optimizations */
    .btn {
        min-height: 44px;
        font-size: 0.95rem;
        padding: 0.65rem 1rem;
    }

    .btn-sm {
        min-height: 38px;
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }

    /* Action buttons in tables */
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .btn-group .btn {
        width: 100%;
        border-radius: 6px !important;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        min-height: 44px;
    }

    .btn-group .btn i {
        font-size: 1rem;
    }

    /* Show text on mobile for action buttons */
    .btn-group .btn[data-bs-toggle="tooltip"]::after {
        content: attr(title);
        margin-left: 0.5rem;
    }

    /* Primary action buttons */
    .card-header {
        padding: 1rem;
        font-size: 1rem;
    }

    .card-header > div {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .card-header .btn {
        width: 100%;
        min-height: 48px;
        font-size: 1rem;
        font-weight: 600;
    }

    /* Form buttons */
    .d-flex.justify-content-between {
        flex-direction: column !important;
        gap: 0.75rem;
    }

    .d-flex.justify-content-between .btn {
        width: 100%;
        min-height: 48px;
    }

    /* Filter buttons */
    .card-body form .d-flex {
        flex-direction: column !important;
        gap: 0.75rem;
    }

    .card-body form .d-flex .btn {
        width: 100%;
        min-height: 48px;
    }

    /* Form controls */
    .form-control, .form-select {
        font-size: 16px;
        padding: 0.75rem;
        min-height: 48px;
    }

    /* Tab navigation */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-bottom: 2px solid #dee2e6;
    }

    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
        min-height: 44px;
    }

    /* Inline table add buttons */
    .btn-success.mb-2 {
        width: 100%;
        min-height: 48px;
        margin-bottom: 1rem !important;
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }

    /* Alerts */
    .alert {
        font-size: 0.9rem;
        padding: 1rem;
    }

    /* Badge sizing */
    .badge {
        font-size: 0.7rem;
        padding: 0.35rem 0.6rem;
    }

    /* Dropdown menu */
    .dropdown-menu {
        width: 100%;
        max-width: 300px;
    }

    .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    .table-striped>tbody>tr:nth-of-type(odd)>* {
    --bs-table-bg-type: transparent;
    }
}

/* Extra small devices optimization */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 5px;
        padding-right: 5px;
    }

    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table tbody tr {
        padding: 0.75rem;
    }

    .btn {
        font-size: 0.9rem;
    }

    .nav-tabs .nav-link {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-color);
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Pulse animation for success messages */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 4px 16px rgba(25, 135, 84, 0.3);
    }
}

/* Enhanced alert visibility */
.alert-success {
    border-left: 4px solid var(--success-color);
    font-weight: 500;
}

.alert-success i {
    font-size: 1.2rem;
    vertical-align: middle;
}
