/**
 * GENERAL VISUAL POLISH
 * Genspark Training Platform v3.0
 * Final polish for buttons, forms, and UI elements
 */

/* ===========================
   ENHANCED BUTTONS
   =========================== */

/* Primary buttons with gradient */
.btn-primary,
button[type="submit"]:not(.quiz-option):not(.timestamp-btn) {
    background: linear-gradient(135deg, var(--apple-blue) 0%, var(--apple-purple) 100%);
    color: white;
    padding: 16px 32px;
    border-radius: 14px;
    border: none;
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover,
button[type="submit"]:not(.quiz-option):not(.timestamp-btn):hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 122, 255, 0.4);
}

.btn-primary:active,
button[type="submit"]:not(.quiz-option):not(.timestamp-btn):active {
    transform: translateY(-1px);
}

/* Secondary buttons */
.btn-secondary {
    background: white;
    color: var(--apple-blue);
    padding: 16px 32px;
    border-radius: 14px;
    border: 2px solid var(--apple-blue);
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-secondary:hover {
    background: var(--apple-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.3);
}

/* Generate button special styling */
#generateBtn {
    min-width: 200px;
    justify-content: center;
    font-size: 1.125rem;
    padding: 18px 40px;
}

#generateBtn i {
    font-size: 1.25rem;
}

/* Navigation buttons */
.nav-btn,
.section-nav-btn {
    background: linear-gradient(135deg, var(--apple-blue) 0%, var(--apple-purple) 100%);
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover,
.section-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.35);
}

.nav-btn:disabled,
.section-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===========================
   ENHANCED FORM ELEMENTS
   =========================== */

/* Input fields */
input[type="text"],
input[type="url"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--apple-gray-200);
    border-radius: 14px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    color: var(--apple-gray-900);
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
    transform: translateY(-1px);
}

input[type="text"]::placeholder,
input[type="url"]::placeholder,
input[type="email"]::placeholder,
textarea::placeholder {
    color: var(--apple-gray-400);
}

/* Form labels */
label {
    display: block;
    font-weight: 600;
    color: var(--apple-gray-900);
    margin-bottom: 10px;
    font-size: 1rem;
}

label i {
    margin-right: 6px;
    color: var(--apple-blue);
}

/* Form groups */
.form-group {
    margin-bottom: 24px;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* Helper text */
.form-helper {
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--apple-gray-500);
    display: flex;
    align-items: start;
    gap: 6px;
}

.form-helper i {
    margin-top: 2px;
    color: var(--apple-blue);
}

/* ===========================
   ENHANCED CARDS
   =========================== */

/* General card styling */
.card,
.task-card,
.resource-card {
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover,
.task-card:hover,
.resource-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Card headers */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--apple-gray-100);
}

.card-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #000000;
    margin: 0;
    letter-spacing: -0.01em;
}

/* Card icons */
.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--apple-blue) 0%, var(--apple-purple) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

/* ===========================
   BADGES AND TAGS
   =========================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-primary {
    background: linear-gradient(135deg, var(--apple-blue) 0%, var(--apple-purple) 100%);
    color: white;
}

.badge-success {
    background: linear-gradient(135deg, var(--apple-green) 0%, #30D158 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, var(--apple-yellow) 0%, var(--apple-orange) 100%);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.15) 0%, rgba(88, 86, 214, 0.15) 100%);
    color: var(--apple-blue);
    border: 1px solid var(--apple-blue);
}

/* ===========================
   SECTION TITLES
   =========================== */

.section-title {
    font-size: 2.75rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--apple-gray-600);
    margin-bottom: 48px;
    line-height: 1.6;
}

/* ===========================
   LOADING STATES
   =========================== */

.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.skeleton {
    background: linear-gradient(90deg, var(--apple-gray-100) 25%, var(--apple-gray-50) 50%, var(--apple-gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

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

/* ===========================
   ALERTS AND NOTIFICATIONS
   =========================== */

.alert {
    padding: 16px 20px;
    border-radius: 14px;
    display: flex;
    align-items: start;
    gap: 14px;
    margin-bottom: 24px;
}

.alert i {
    font-size: 1.25rem;
    margin-top: 2px;
}

.alert-success {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.12) 0%, rgba(48, 209, 88, 0.12) 100%);
    border-left: 4px solid var(--apple-green);
    color: var(--apple-gray-900);
}

.alert-success i {
    color: var(--apple-green);
}

.alert-info {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.12) 0%, rgba(88, 86, 214, 0.12) 100%);
    border-left: 4px solid var(--apple-blue);
    color: var(--apple-gray-900);
}

.alert-info i {
    color: var(--apple-blue);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.12) 0%, rgba(255, 149, 0, 0.12) 100%);
    border-left: 4px solid var(--apple-yellow);
    color: var(--apple-gray-900);
}

.alert-warning i {
    color: var(--apple-yellow);
}

.alert-error {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.12) 0%, rgba(255, 69, 58, 0.12) 100%);
    border-left: 4px solid var(--apple-red);
    color: var(--apple-gray-900);
}

.alert-error i {
    color: var(--apple-red);
}

/* ===========================
   DIVIDERS
   =========================== */

hr,
.divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--apple-gray-200), transparent);
    margin: 48px 0;
}

/* ===========================
   TOOLTIPS
   =========================== */

[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: var(--apple-gray-900);
    color: white;
    font-size: 0.8125rem;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* ===========================
   ANIMATIONS
   =========================== */

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.slide-in-left {
    animation: slideInLeft 0.6s ease forwards;
}

.slide-in-right {
    animation: slideInRight 0.6s ease forwards;
}

.scale-in {
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ===========================
   RESPONSIVE POLISH
   =========================== */

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1.0625rem;
    }
    
    .btn-primary,
    .btn-secondary,
    button[type="submit"]:not(.quiz-option):not(.timestamp-btn) {
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    .card,
    .task-card,
    .resource-card {
        padding: 24px;
    }
}

/* ===========================
   SCROLLBAR STYLING
   =========================== */

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--apple-gray-50);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--apple-blue) 0%, var(--apple-purple) 100%);
    border-radius: 6px;
    border: 2px solid var(--apple-gray-50);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0051D5 0%, #4E4BA8 100%);
}

/* ===========================
   SELECTION STYLING
   =========================== */

::selection {
    background: var(--apple-blue);
    color: white;
}

::-moz-selection {
    background: var(--apple-blue);
    color: white;
}
