/* 호주장터 클래스 - Main Stylesheet */

:root {
    --primary-color: #FF7E00;
    --primary-dark: #e67100;
    --secondary-color: #1f2937;
    --accent-color: #2563eb;
    --success-color: #10b981;
    --dark-color: #111827;
    --light-bg: #fffbf7;
    /* Warmer light background */
    --surface-color: #ffffff;

    /* Soft UI Shadows */
    --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 20px 40px -5px rgba(255, 126, 0, 0.15);
    --button-shadow: 0 10px 20px -10px rgba(255, 126, 0, 0.5);

    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
}

/* Global Styles */
body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--dark-color);
    background-color: #f9fafb;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Better font rendering on mobile */
@media (max-width: 768px) {
    body {
        font-size: 15px;
        line-height: 1.5;
    }
    
    h1, h2, h3, h4, h5, h6 {
        font-weight: 700;
        line-height: 1.3;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }
    
    p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    small, .small {
        font-size: 0.85rem;
    }
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.navbar-brand img {
    max-height: 42px;
}

.nav-link {
    font-weight: 600;
    color: var(--secondary-color) !important;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem !important;
    border-radius: var(--border-radius-sm);
}

.nav-link:hover {
    color: var(--primary-color) !important;
    background: var(--light-bg);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(120deg, var(--primary-color) 0%, #ff9f43 100%);
    min-height: 65vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Buttons */
.btn {
    border-radius: var(--border-radius-sm);
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    box-shadow: var(--button-shadow);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(255, 126, 0, 0.4);
}

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

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: var(--button-shadow);
    transform: translateY(-2px);
}

/* Course Cards - Premium Soft UI */
.course-card {
    border: none;
    border-radius: var(--border-radius-lg);
    background: var(--surface-color);
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    height: 100%;
}

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

.course-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.course-card:hover .card-img-top {
    transform: scale(1.05);
}

.course-card .badge {
    padding: 0.6em 1em;
    border-radius: 8px;
    font-weight: 700;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .hero-section {
        min-height: auto;
        padding: 80px 0 60px;
        text-align: center;
    }

    .hero-section .d-flex {
        justify-content: center;
    }

    .course-card .card-img-top {
        height: 160px;
    }
}

.course-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
}

.course-price-original {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 0.9rem;
    margin-left: 8px;
}

/* Category Cards - 숨고 스타일 */
.category-card .card {
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 12px;
}

.category-card:hover .card {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.category-icon-card {
    border-radius: 16px;
    transition: all 0.25s ease;
}

.category-icon-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.category-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.category-icon-wrapper i {
    font-size: 24px;
}

.category-card:hover .category-icon-wrapper {
    transform: scale(1.1);
}

.category-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-color);
    line-height: 1.3;
}

@media (max-width: 576px) {
    .category-icon-wrapper {
        width: 48px;
        height: 48px;
    }

    .category-icon-wrapper i {
        font-size: 20px;
    }

    .category-name {
        font-size: 0.75rem;
    }

    .category-icon-card {
        padding: 12px 8px !important;
    }
}

/* Rating Stars */
.rating {
    color: var(--secondary-color);
}

/* Instructor Badge */
.instructor-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Video Player Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 12px;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 80px;
}

/* Course Curriculum */
.curriculum-item {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.2s;
}

.curriculum-item:hover {
    background: var(--light-bg);
}

.curriculum-item.active {
    background: #eff6ff;
    border-left: 3px solid var(--primary-color);
}

.curriculum-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Dashboard Styles */
.dashboard-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-card {
    padding: 24px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    background-color: var(--primary-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .hero-section {
        min-height: auto;
        padding: 50px 0 40px;
    }

    .hero-section h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .hero-section p {
        font-size: 0.95rem;
    }

    .navbar-nav {
        padding: 15px 0;
    }
    
    .navbar-brand img {
        max-height: 36px;
    }

    .course-card .card-img-top {
        height: 140px;
    }
    
    .course-card .card-body {
        padding: 14px;
    }
    
    .course-card .card-title {
        font-size: 0.9rem;
    }

    .sidebar {
        position: static;
        margin-top: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    /* Reduce padding on mobile */
    .category-section,
    .course-section,
    .cta-section {
        padding: 50px 0;
    }
    
    /* Better touch targets */
    .nav-link {
        padding: 12px 16px !important;
    }
    
    /* Optimize card spacing */
    .row.g-4 {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }
}

/* Form Styles */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

/* File Upload */
.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: #f8fafc;
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background: #eff6ff;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Admin Styles */
.admin-sidebar {
    min-height: 100vh;
    background: var(--dark-color);
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 2px 10px;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
}

/* Tables */
.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Badges */
.badge-status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-status-approved {
    background-color: #d1fae5;
    color: #065f46;
}

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

/* ===== Video Security Styles ===== */

/* Prevent text selection on video pages */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Video container security */
.secure-video-container {
    position: relative;
    background: #000;
    overflow: hidden;
}

.secure-video-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

/* Watermark styles */
.video-watermark {
    position: absolute;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.08);
    pointer-events: none;
    z-index: 100;
    font-family: 'Courier New', monospace;
    text-shadow: none;
    letter-spacing: 1px;
}

/* reCAPTCHA styling */
.g-recaptcha {
    margin-bottom: 1rem;
}

@media (max-width: 400px) {
    .g-recaptcha {
        transform: scale(0.9);
        transform-origin: 0 0;
    }
}

/* Security warning modal */
.security-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.security-modal-content {
    text-align: center;
    padding: 40px;
}

.security-modal-content i {
    font-size: 64px;
    color: #dc3545;
    margin-bottom: 20px;
}

/* Blur effect for security */
.content-blur {
    filter: blur(20px);
    pointer-events: none;
}

/* Copyright notice */
.copyright-watermark {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.2);
    pointer-events: none;
    z-index: 1000;
}

/* Social login buttons */
.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-google {
    background: #fff;
    border: 1px solid #dadce0;
    color: #3c4043;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #dadce0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-kakao {
    background: #FEE500;
    border: none;
    color: #000000;
}

.btn-kakao:hover {
    background: #FDD835;
}

.btn-naver {
    background: #03C75A;
    border: none;
    color: #fff;
}

.btn-naver:hover {
    background: #02b351;
}

/* Invoice styles */
.invoice-box {
    max-width: 800px;
    margin: auto;
    padding: 30px;
    border: 1px solid #eee;
    box-shadow: 0 0 10px rgba(0, 0, 0, .15);
    font-size: 14px;
    line-height: 24px;
    color: #555;
}

.invoice-box table {
    width: 100%;
    line-height: inherit;
    text-align: left;
}

.invoice-box table td {
    padding: 5px;
    vertical-align: top;
}

.invoice-box table tr.top table td {
    padding-bottom: 20px;
}

.invoice-box table tr.heading td {
    background: #eee;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
}

.invoice-box table tr.item td {
    border-bottom: 1px solid #eee;
}

.invoice-box table tr.total td:nth-child(2) {
    border-top: 2px solid #eee;
    font-weight: bold;
}

@media print {
    .no-print {
        display: none !important;
    }

    .invoice-box {
        box-shadow: none;
        border: none;
    }
}


/* ===== Additional Mobile Optimizations ===== */

/* Improved touch targets */
@media (max-width: 768px) {
    a, button, .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Better spacing for mobile */
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* Optimize navbar for mobile */
    .navbar {
        padding: 8px 0;
    }
    
    .navbar-toggler {
        padding: 8px 12px;
        border: none;
        border-radius: 8px;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
        background: #f3f4f6;
    }
    
    .navbar-collapse {
        margin-top: 12px;
    }
    
    .navbar-nav .nav-link {
        padding: 12px 16px !important;
        border-radius: 8px;
        margin: 2px 0;
    }
    
    .navbar-nav .nav-link:active {
        background: #f3f4f6;
    }
    
    /* Dropdown improvements */
    .dropdown-menu {
        border: none;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        border-radius: 12px;
        margin-top: 8px;
    }
    
    .dropdown-item {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    
    /* Card optimizations */
    .card {
        border-radius: 12px;
        overflow: hidden;
    }
    
    .card-body {
        padding: 16px;
    }
    
    /* Form improvements */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 16px;
        border-radius: 8px;
    }
    
    .form-label {
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 8px;
    }
    
    /* Modal improvements */
    .modal-content {
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 20px;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 16px 20px;
        border-top: 1px solid #e5e7eb;
    }
    
    /* Better image handling */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
    
    /* Optimize tables for mobile */
    .table-responsive {
        border-radius: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Better alert styling */
    .alert {
        border-radius: 12px;
        padding: 16px;
        font-size: 0.9rem;
    }
    
    /* Improved badge styling */
    .badge {
        padding: 6px 12px;
        font-size: 0.75rem;
        border-radius: 6px;
    }
    
    /* Better pagination */
    .pagination {
        gap: 4px;
    }
    
    .page-link {
        padding: 8px 12px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
}

/* Extra small devices optimization */
@media (max-width: 576px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.15rem; }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .hero-section {
        padding: 40px 0 30px;
    }
    
    .category-section,
    .course-section,
    .cta-section {
        padding: 40px 0;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 40px 0;
    }
    
    .modal-dialog {
        max-width: 90%;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari */
    input, textarea, select {
        font-size: 16px !important; /* Prevents zoom */
    }
    
    .btn {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
