/* ============================================
   IRCC Portal - Custom Styles
   Government of Canada Design System
   ============================================ */

/* Base resets */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Focus styles - WCAG compliant */
:focus-visible {
    outline: 3px solid #34557e;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #34557e;
    outline-offset: 2px;
}

/* GC Button styles */
.btn-primary {
    @apply bg-gc-blue text-white font-semibold py-3 px-6 rounded hover:bg-gc-blue-light transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-gc-blue focus-visible:ring-offset-2;
}

.btn-secondary {
    @apply bg-white text-gc-blue font-semibold py-3 px-6 rounded border-2 border-gc-blue hover:bg-gc-blue hover:text-white transition-colors duration-200;
}

.btn-danger {
    @apply bg-gc-red-dark text-white font-semibold py-3 px-6 rounded hover:bg-red-700 transition-colors duration-200;
}

.btn-success {
    @apply bg-gc-green text-white font-semibold py-3 px-6 rounded hover:bg-gc-green-light transition-colors duration-200;
}

.btn-sm {
    @apply py-2 px-4 text-sm;
}

.btn-lg {
    @apply py-4 px-8 text-lg;
}

/* Card styles */
.gc-card {
    @apply bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden transition-shadow duration-300;
}

.gc-card:hover {
    @apply shadow-lg;
}

.gc-card-header {
    @apply bg-gc-blue text-white px-6 py-4 font-bold text-lg;
}

.gc-card-body {
    @apply p-6;
}

/* Form styles */
.gc-input {
    @apply w-full border-2 border-gray-300 rounded px-4 py-3 text-gc-blue bg-white focus:border-gc-blue focus:ring-1 focus:ring-gc-blue transition-colors duration-200 placeholder:text-gc-gray-dark;
}

.gc-input:focus {
    @apply outline-none border-gc-blue;
}

.gc-input.error {
    @apply border-gc-red-dark;
}

.gc-label {
    @apply block font-semibold text-gc-blue mb-2;
}

.gc-select {
    @apply w-full border-2 border-gray-300 rounded px-4 py-3 text-gc-blue bg-white focus:border-gc-blue focus:ring-1 focus:ring-gc-blue transition-colors duration-200 appearance-none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2326374a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.gc-checkbox {
    @apply w-5 h-5 text-gc-blue border-2 border-gray-300 rounded focus:ring-gc-blue;
}

.gc-radio {
    @apply w-5 h-5 text-gc-blue border-2 border-gray-300 focus:ring-gc-blue;
}

/* Error message */
.gc-error {
    @apply text-gc-red-dark text-sm mt-1 flex items-center space-x-1;
}

/* Alert styles */
.gc-alert {
    @apply border-l-4 p-4 mb-4;
}

.gc-alert-info {
    @apply bg-blue-50 border-blue-400 text-blue-800;
}

.gc-alert-success {
    @apply bg-green-50 border-green-400 text-green-800;
}

.gc-alert-warning {
    @apply bg-yellow-50 border-yellow-500 text-yellow-800;
}

.gc-alert-danger {
    @apply bg-red-50 border-gc-red-dark text-red-800;
}

/* Status badge */
.status-badge {
    @apply inline-flex items-center px-3 py-1 rounded-full text-sm font-semibold;
}

.status-received {
    @apply bg-blue-100 text-blue-800;
}

.status-processing {
    @apply bg-yellow-100 text-yellow-800;
}

.status-approved {
    @apply bg-green-100 text-green-800;
}

.status-rejected {
    @apply bg-red-100 text-red-800;
}

.status-additional {
    @apply bg-orange-100 text-orange-800;
}

/* Progress bar */
.gc-progress {
    @apply w-full bg-gray-200 rounded-full h-3 overflow-hidden;
}

.gc-progress-bar {
    @apply h-full rounded-full transition-all duration-1000 ease-out;
}

/* Table styles */
.gc-table {
    @apply w-full text-left;
}

.gc-table thead {
    @apply bg-gc-blue text-white;
}

.gc-table th {
    @apply px-4 py-3 font-semibold text-sm;
}

.gc-table td {
    @apply px-4 py-3 border-b border-gray-200;
}

.gc-table tbody tr:hover {
    @apply bg-gray-50;
}

/* Stepper */
.stepper {
    @apply flex items-center justify-between;
}

.stepper-step {
    @apply flex flex-col items-center relative;
}

.stepper-circle {
    @apply w-10 h-10 rounded-full flex items-center justify-center font-bold text-sm border-2 transition-all duration-300;
}

.stepper-circle.active {
    @apply bg-gc-blue text-white border-gc-blue;
}

.stepper-circle.completed {
    @apply bg-gc-green text-white border-gc-green;
}

.stepper-circle.pending {
    @apply bg-white text-gc-gray-dark border-gray-300;
}

.stepper-line {
    @apply flex-1 h-1 mx-2;
}

.stepper-line.completed {
    @apply bg-gc-green;
}

.stepper-line.pending {
    @apply bg-gray-300;
}

/* Toast animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.toast-enter {
    animation: slideInRight 0.3s ease-out;
}

.toast-exit {
    animation: slideOutRight 0.3s ease-in;
}

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

.page-enter {
    animation: fadeIn 0.3s ease-out;
}

/* Well / Info box */
.gc-well {
    @apply bg-gray-50 border border-gray-200 rounded p-4;
}

/* Print styles */
@media print {
    header, nav, footer, #breadcrumb-bar, .btn-primary, .btn-secondary {
        display: none !important;
    }
    main {
        margin: 0 !important;
        padding: 0 !important;
    }
    .gc-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

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

.spinner {
    animation: spin 1s linear infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #aaa;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Hero gradient overlay */
.hero-gradient {
    background: linear-gradient(135deg, rgba(38,55,74,0.95) 0%, rgba(52,85,126,0.85) 100%);
}

/* Animation utilities */
@keyframes pulse-gentle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.pulse-gentle {
    animation: pulse-gentle 2s ease-in-out infinite;
}

/* Mobile menu transition */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#mobile-menu.open {
    max-height: 500px;
}