/* Azure Cert Prep - Shared Styles */

/* Prevent pull-to-refresh on mobile */
body {
    overscroll-behavior-y: contain;
    -webkit-tap-highlight-color: transparent;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* GPU acceleration for smooth animations */
.gpu-accelerate {
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

/* Animation for card transitions */
@keyframes fadeIn {
    from { opacity: 0; transform: translate3d(0, 10px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translate3d(20px, 0, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes slideLeft {
    from { opacity: 0; transform: translate3d(100%, 0, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes slideRight {
    from { opacity: 0; transform: translate3d(-100%, 0, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.animate-fadeIn {
    animation: fadeIn 0.2s ease-out;
}

.animate-slideIn {
    animation: slideIn 0.2s ease-out;
}

.animate-slideLeft {
    animation: slideLeft 0.2s ease-out;
}

.animate-slideRight {
    animation: slideRight 0.2s ease-out;
}

/* Touch-friendly sizing */
button, input, select, label {
    touch-action: manipulation;
}

/* Tap navigation container */
.tap-navigation {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

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

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Safe area padding for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
    .safe-top {
        padding-top: env(safe-area-inset-top);
    }
    .safe-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Disable text selection on buttons */
button {
    -webkit-user-select: none;
    user-select: none;
}

/* Dark mode styles */
.dark {
    color-scheme: dark;
}

.dark body {
    background-color: #1a1a2e;
}

html.dark .bg-gray-100,
.dark .bg-gray-100 {
    background-color: #1a1a2e !important;
}

html.dark .bg-white,
html.dark [class*="bg-white"],
.dark .bg-white {
    background-color: #1e293b !important;
}

html.dark .bg-gray-50,
.dark .bg-gray-50 {
    background-color: #1f2937 !important;
}

html.dark .text-gray-900,
.dark .text-gray-900 {
    color: #f1f5f9 !important;
}

html.dark .text-gray-800,
.dark .text-gray-800 {
    color: #e2e8f0 !important;
}

html.dark .text-gray-700,
.dark .text-gray-700 {
    color: #cbd5e1 !important;
}

html.dark .text-gray-600,
.dark .text-gray-600 {
    color: #94a3b8 !important;
}

html.dark .text-gray-500,
.dark .text-gray-500 {
    color: #64748b !important;
}

html.dark .border-gray-300,
.dark .border-gray-300 {
    border-color: #475569 !important;
}

html.dark .border-b,
.dark .border-b {
    border-color: #475569 !important;
}

html.dark .border-t,
.dark .border-t {
    border-color: #475569 !important;
}

html.dark .shadow-lg,
html.dark .shadow-2xl,
.dark .shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3) !important;
}

/* Dark mode for specific components */
html.dark .rounded-2xl.bg-white,
html.dark .rounded-xl.bg-white {
    background-color: #1e293b !important;
    border: 1px solid #334155;
}

html.dark .bg-green-50 {
    background-color: #064e3b !important;
}

html.dark .bg-blue-50 {
    background-color: #1e3a5f !important;
}

html.dark .text-green-800 {
    color: #6ee7b7 !important;
}

html.dark .text-blue-800 {
    color: #93c5fd !important;
}

/* Loading state */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #312e81 0%, #581c87 50%, #312e81 100%);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Exam card hover effects */
.exam-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.exam-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.exam-card:active {
    transform: translateY(-2px);
}
