/* ==========================================================================
   COMPONENTS CSS - Individual component styles
   ========================================================================== */

/* Navigation Components */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--animation);
    font-weight: 500;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary-color);
    background: var(--surface);
    text-decoration: none;
}

.nav-link.active {
    color: var(--primary-color);
    background: var(--primary-light);
}

.nav-link span {
    margin-left: 0.25rem;
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle::after {
    margin-left: 0.5rem;
    transition: var(--animation);
}

.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--animation);
    z-index: 1000;
}

.nav-dropdown:hover .dropdown-menu,
.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--animation);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--surface);
    color: var(--primary-color);
    text-decoration: none;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: var(--radius);
    transition: var(--animation);
}

.mobile-menu-toggle:hover {
    background: var(--surface);
}

.hamburger {
    display: flex;
    flex-direction: column;
    width: 24px;
    gap: 4px;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    transition: var(--animation);
    border-radius: 2px;
}

/* Mobile menu animation */
.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--animation);
    position: relative;
    overflow: hidden;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1;
    border: 2px solid transparent;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--animation);
}

.btn:hover::before {
    left: 100%;
}

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

.btn:active {
    transform: translateY(-1px);
    transition: transform 0.1s ease;
}

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

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

.btn-primary:hover {
    color: white;
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border-color: var(--border);
    box-shadow: var(--shadow);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--primary-color);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

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

/* Button Sizes */
.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}
/* Cards */
.card {
    background: var(--background);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--animation);
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.card-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
    flex: 1;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Photo Components */
.photo-item {
    background: var(--background);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--animation);
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.photo-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.photo-image {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: var(--surface);
}

.photo-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--animation);
    display: block;
}

.photo-item:hover .photo-main-image {
    transform: scale(1.05);
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--animation);
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.photo-actions {
    display: flex;
    gap: 0.75rem;
}

.photo-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.photo-title {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.photo-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--animation);
}

.photo-title a:hover {
    color: var(--primary-color);
}

.photo-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}

.photo-categories {
    margin-bottom: 0.75rem;
}

.photo-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.photo-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.photo-meta i {
    opacity: 0.7;
}

/* Tags and Categories */
.tags,
.photo-categories {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin: var(--spacing-md) 0;
}

.tag,
.category {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    transition: var(--animation);
    line-height: 1;
    border: 1px solid transparent;
}

.tag {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary-light);
}

.tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.category {
    background: var(--surface);
    color: var(--text-secondary);
    border-color: var(--border);
}

.category:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
}

/* Forms */
.form-section {
    background: var(--background);
    padding: var(--spacing-2xl);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: var(--spacing-xl) 0;
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
}

.form-control {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: var(--font-size-base);
    transition: var(--animation);
    background: var(--background);
    color: var(--text-primary);
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control:hover {
    border-color: var(--primary-color);
}

.form-control:disabled {
    background-color: var(--surface);
    color: var(--text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-control.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Form control variants */
select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5rem 1.5rem;
    padding-right: 3rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    line-height: var(--line-height-relaxed);
}
.breadcrumb-item:not(:last-child)::after {
    content: '›';
    margin-left: var(--spacing-sm);
    color: var(--text-light);
    font-weight: var(--font-weight-semibold);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: var(--font-weight-medium);
}

/* Alerts */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius);
    margin: var(--spacing-md) 0;
    border: 1px solid transparent;
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-info {
    background: #dbeafe;
    border-color: #bfdbfe;
    color: #1e40af;
}

.alert-success {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-warning {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.alert-error {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--animation);
    z-index: var(--z-modal);
    backdrop-filter: blur(4px);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    width: 100%;
    max-width: 90vw;
    max-height: 90vh;
    margin: var(--spacing-xl);
}

.modal-content {
    background: var(--background);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    flex-shrink: 0;
}

.modal-title {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    line-height: var(--line-height-tight);
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    flex-shrink: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-full);
    transition: var(--animation);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--border);
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* Photo Modal Specific */
.modal-image-container {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.modal-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.modal-details {
    text-align: left;
}

.modal-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: var(--line-height-relaxed);
}

.modal-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.modal-tags {
    flex: 1;
}

.modal-actions {
    display: flex;
    gap: var(--spacing-md);
    flex-shrink: 0;
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    border: 3px solid var(--primary-color);
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 1;
}

@keyframes spin {
    to { 
        transform: translate(-50%, -50%) rotate(360deg); 
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: var(--animation);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    text-align: center;
    color: var(--primary-color);
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

/* Navigation for photo view */
.navigation-buttons {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    justify-content: center;
    margin: var(--spacing-2xl) 0;
    flex-wrap: wrap;
}

.navigation-buttons .btn {
    min-width: 120px;
    flex: 0 0 auto;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--primary-color);
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--animation);
    transform: scale(0);
    opacity: 0;
    z-index: var(--z-fixed);
}

.back-to-top.visible {
    transform: scale(1);
    opacity: 1;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

/* Notification system */
.flash-messages {
    position: fixed;
    top: var(--spacing-xl);
    right: var(--spacing-xl);
    z-index: var(--z-toast);
    max-width: 400px;
    width: 100%;
}

.notification {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transform: translateX(100%);
    transition: var(--animation);
    position: relative;
    overflow: hidden;
}

.notification.show {
    transform: translateX(0);
}

.notification.notification-success {
    border-left-color: #10b981;
    background: #ecfdf5;
    color: #047857;
}

.notification.notification-error {
    border-left-color: #ef4444;
    background: #fef2f2;
    color: #dc2626;
}

.notification.notification-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.notification.notification-info {
    border-left-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}

.notification i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: var(--animation);
    margin-left: auto;
    opacity: 0.7;
}

.notification-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: var(--text-primary);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    z-index: var(--z-tooltip);
    pointer-events: none;
    white-space: nowrap;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: var(--animation);
}

.tooltip.show {
    opacity: 1;
    visibility: visible;
}

.tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--text-primary);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scroll reveal animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Loading state for images */
img.loading {
    background: var(--surface);
    background-image: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

img.loaded {
    animation: none;
}

img.error {
    background: var(--surface);
    border: 2px dashed var(--border);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: var(--text-light);
}

img.error::before {
    content: '⚠ Błąd ładowania';
    position: absolute;
    font-size: 0.875rem;
}

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

/* Dodaj to do frontend/web/css/components.css */

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--animation);
    user-select: none;
    vertical-align: middle;
    background: none;
    min-height: 44px; /* Accessibility - minimum touch target */
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Button sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
    min-height: 36px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: var(--font-size-lg);
    min-height: 52px;
}

/* Form controls */
.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background: var(--background);
    background-clip: padding-box;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--animation);
    min-height: 44px; /* Accessibility */
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
    color: var(--text-light);
    opacity: 1;
}

.form-control:disabled {
    background: var(--surface);
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.form-text {
    margin-top: 0.25rem;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Form validation */
.form-control.is-valid {
    border-color: var(--success-color);
}

.form-control.is-invalid {
    border-color: var(--error-color);
}

.valid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: var(--font-size-sm);
    color: var(--success-color);
}

.invalid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: var(--font-size-sm);
    color: var(--error-color);
}

/* Cards */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--animation);
}

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

.card-header {
    padding: 1rem 1.5rem;
    margin-bottom: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-body {
    flex: 1 1 auto;
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
}

.card-title {
    margin-bottom: 1rem;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.card-subtitle {
    margin-bottom: 0.5rem;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.card-text {
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: var(--line-height-relaxed);
}

/* Alerts */
.alert {
    position: relative;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    color: var(--success-dark);
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
}

.alert-info {
    color: var(--info-dark);
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info-color);
}

.alert-warning {
    color: var(--warning-dark);
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning-color);
}

.alert-error,
.alert-danger {
    color: var(--error-dark);
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error-color);
}

.alert-dismissible {
    padding-right: 3rem;
}

.alert-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: var(--animation);
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
}

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

.badge-secondary {
    color: white;
    background: var(--secondary-color);
}

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

.badge-warning {
    color: var(--warning-dark);
    background: var(--warning-color);
}

.badge-error,
.badge-danger {
    color: white;
    background: var(--error-color);
}

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

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25rem solid var(--border);
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

.spinner-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.125rem;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: var(--animation);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: var(--background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}

.loading-spinner i {
    font-size: 2rem;
    color: var(--primary-color);
}

/* Flash messages */
.flash-messages {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: var(--z-toast);
    max-width: 400px;
    width: 100%;
}

.flash-message {
    margin-bottom: 0.5rem;
    opacity: 0;
    transform: translateX(100%);
    animation: slideInRight 0.3s ease-out forwards;
}

.flash-message.removing {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Tooltips */
.tooltip {
    position: absolute;
    z-index: var(--z-tooltip);
    display: block;
    margin: 0;
    font-family: var(--font-family-base);
    font-style: normal;
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    text-align: left;
    text-decoration: none;
    text-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    word-break: normal;
    word-spacing: normal;
    white-space: normal;
    line-break: auto;
    font-size: var(--font-size-sm);
    word-wrap: break-word;
    opacity: 0;
}

.tooltip.show {
    opacity: 0.9;
}

.tooltip-inner {
    max-width: 200px;
    padding: 0.5rem 0.75rem;
    color: white;
    text-align: center;
    background: var(--text-primary);
    border-radius: var(--radius);
}

/* Responsive utilities */
@media (max-width: 768px) {
    .flash-messages {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
    
    .btn {
        min-height: 48px; /* Larger touch targets on mobile */
    }
    
    .btn-sm {
        min-height: 40px;
    }
    
    .btn-lg {
        min-height: 56px;
    }
    
    .form-control {
        min-height: 48px;
    }
}

/* Print styles */
@media print {
    .btn,
    .alert-close,
    .flash-messages,
    .loading-overlay,
    .back-to-top {
        display: none;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .alert {
        border: 1px solid #000;
    }
}