/* Custom CSS to enhance Tailwind CSS styling for ConRAM */

/* Root variables for consistent theming */
:root {
    --primary-color: #1f6d77;
    --primary-dark: #175362;
    --accent-color: #4f8791;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
}

/* Smooth transitions for interactive elements */
* {
    transition-duration: 150ms;
}

/* Enhanced form inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    transition: all 150ms ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(31, 109, 119, 0.15);
}

/* Button hover effects */
button[type="submit"],
.btn,
[role="button"] {
    transition: all 150ms ease;
}

button[type="submit"]:hover,
.btn:hover,
[role="button"]:hover {
    transform: translateY(-2px);
}

button[type="submit"]:active,
.btn:active,
[role="button"]:active {
    transform: translateY(0);
}

/* Table styling enhancements */
table {
    border-collapse: collapse;
}

tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

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

tbody tr:hover {
    background-color: #f9fafb;
}

/* Badge styling */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Status badge colors */
.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e3a8a;
}

/* Card enhancements */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.card-header {
    background: linear-gradient(90deg, var(--accent-color), #5e95a0);
    color: white;
    padding: 1.5rem;
    border-radius: 0.5rem 0.5rem 0 0;
}

/* Dropdown enhancements */
.dropdown-menu-custom {
    animation: slideDown 200ms ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Link styling */
a {
    color: var(--primary-color);
    transition: color 150ms ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Navbar enhancements */
.navbar-enhanced {
    position: relative;
}

.navbar-enhanced::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4f8791, #75aab2);
    opacity: 0.5;
}

/* Desktop sticky navbar */
@media (min-width: 769px) {
    nav.navbar-enhanced {
        position: sticky;
        top: 0;
        z-index: 50;
    }
}

/* Mobile collapsible section styles */
@media (max-width: 768px) {
    .mobile-menu-section {
        border-left: 2px solid rgba(255, 255, 255, 0.3);
        padding-left: 0.75rem;
    }
    
    .mobile-section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        user-select: none;
        padding: 0.75rem 0.75rem;
        border-radius: 0.375rem;
        transition: background-color 150ms ease;
    }
    
    .mobile-section-header:active {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-section-content {
        max-height: 500px;
        overflow: hidden;
        transition: max-height 300ms ease, opacity 300ms ease;
        opacity: 1;
    }
    
    .mobile-section-content.collapsed {
        max-height: 0;
        opacity: 0;
    }
    
    .mobile-section-icon {
        transition: transform 300ms ease;
    }
    
    .mobile-section-icon.collapsed {
        transform: rotate(-90deg);
    }
}

/* Mobile responsiveness tweaks */
@media (max-width: 768px) {
    main {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    nav,
    footer,
    .no-print {
        display: none;
    }
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fadeIn 300ms ease;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Ensure text is readable on all backgrounds */
body {
    color: #1e2c31;
    background-color: #f9fafb;
}
