/* ================================
   Derpnerd - Responsive & Utilities
   반응형 디자인 및 유틸리티 클래스
================================ */

/* === UTILITY CLASSES === */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* Margin Utilities */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.5rem !important; }
.m-2 { margin: 1rem !important; }
.m-3 { margin: 1.5rem !important; }
.m-4 { margin: 2rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mt-4 { margin-top: 2rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }
.mb-4 { margin-bottom: 2rem !important; }

.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: 0.5rem !important; }
.ml-2 { margin-left: 1rem !important; }
.ml-3 { margin-left: 1.5rem !important; }
.ml-4 { margin-left: 2rem !important; }

.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: 0.5rem !important; }
.mr-2 { margin-right: 1rem !important; }
.mr-3 { margin-right: 1.5rem !important; }
.mr-4 { margin-right: 2rem !important; }

/* Padding Utilities */
.p-0 { padding: 0 !important; }
.p-1 { padding: 0.5rem !important; }
.p-2 { padding: 1rem !important; }
.p-3 { padding: 1.5rem !important; }
.p-4 { padding: 2rem !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 0.5rem !important; }
.pt-2 { padding-top: 1rem !important; }
.pt-3 { padding-top: 1.5rem !important; }
.pt-4 { padding-top: 2rem !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: 0.5rem !important; }
.pb-2 { padding-bottom: 1rem !important; }
.pb-3 { padding-bottom: 1.5rem !important; }
.pb-4 { padding-bottom: 2rem !important; }

/* Display Utilities */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-none { display: none !important; }

/* Flex Utilities */
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.justify-start { justify-content: flex-start !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.align-start { align-items: flex-start !important; }
.align-center { align-items: center !important; }
.align-end { align-items: flex-end !important; }

/* === RESPONSIVE BREAKPOINTS === */

/* Large Desktop (1200px ~ 1400px) */
@media (max-width: 1400px) {
    :root {
        font-size: 15px;
    }
}

/* Desktop (1024px ~ 1200px) */
@media (max-width: 1200px) {
    body {
        padding-top: 130px !important;
    }
    
    .container {
        padding: 0 1.5rem;
    }
    
    .combined-header {
        padding: 1rem 1.5rem;
    }
    
    .sub-menu {
        padding: 0 1.5rem;
    }
    
    .main-content {
        padding: 2rem 0;
    }
    
    .main-layout {
        padding: 0 1.5rem;
    }
    
    .content-title {
        font-size: 2.5rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

/* Tablet (768px ~ 1024px) */
@media (max-width: 1024px) {
    body {
        padding-top: 120px !important;
    }
    
    .combined-header {
        padding: 1rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .nav-links {
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .sub-menu {
        padding: 0 1rem;
    }
    
    .sub-tab {
        padding: 0.875rem 1rem;
        font-size: 0.8125rem;
    }
    
    .content-title {
        font-size: 2.25rem;
    }
    
    .content-subtitle {
        font-size: 1rem;
    }
    
    .service-card {
        padding: 1.75rem;
    }
    
    .card-title {
        font-size: 1.375rem;
    }
}

/* Mobile (480px ~ 768px) */
@media (max-width: 768px) {
    body {
        padding-top: 110px !important;
    }
    
    .combined-header {
        height: auto;
        min-height: 64px;
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
        padding: 0.875rem 1rem;
    }
    
    .logo {
        font-size: 1.375rem;
    }
    
    .subtitle {
        display: none;
    }
    
    .nav-links {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.375rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }
    
    /* Admin 버튼 간격 제거 */
    .nav-link[href="/admin/"] {
        margin-left: 0 !important;
    }
    
    .nav-link i {
        font-size: 0.75rem;
    }
    
    .sub-menu {
        padding: 0 0.875rem;
        position: relative;
        top: auto;
    }
    
    .sub-menu-tabs {
        gap: 0.25rem;
    }
    
    .sub-tab {
        padding: 0.75rem 0.875rem;
        font-size: 0.8125rem;
    }
    
    .dropdown-content {
        min-width: 200px;
    }
    
    .content-title {
        font-size: 2rem;
    }
    
    .content-subtitle {
        font-size: 0.9375rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .card-header {
        margin-bottom: 1.25rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .card-description {
        font-size: 0.875rem;
    }
    
    .card-stats {
        padding: 1rem;
    }
    
    .stat-item {
        padding: 0.625rem 0;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .main-content {
        padding: 1.5rem 0;
    }
    
    .main-layout {
        padding: 0 1rem;
    }
    
    #footer-wrapper {
        padding: 1.25rem 1rem;
    }
    
    #footer-content {
        font-size: 0.8125rem;
        gap: 0.75rem;
    }
}

/* Small Mobile (~ 480px) */
@media (max-width: 480px) {
    :root {
        font-size: 14px;
    }
    
    body {
        padding-top: 100px !important;
    }
    
    .combined-header {
        padding: 0.75rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .sub-tab {
        padding: 0.625rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .content-title {
        font-size: 1.75rem;
    }
    
    .content-subtitle {
        font-size: 0.875rem;
    }
    
    .service-card {
        padding: 1.25rem;
    }
    
    .card-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .status-badge {
        align-self: flex-start;
    }
    
    .card-title {
        font-size: 1.125rem;
    }
    
    .card-title i {
        font-size: 1rem;
    }
    
    .card-stats {
        padding: 0.875rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }
    
    #footer-content {
        font-size: 0.75rem;
        gap: 0.5rem;
    }
}

/* === PRINT STYLES === */
@media print {
    .combined-header,
    .sub-menu,
    .nav-links,
    .top-body-spacer,
    #site-footer {
        display: none !important;
    }
    
    body {
        padding-top: 0 !important;
    }
    
    .main-content {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .service-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-main: #0f0f0f;
        --bg-card: #1a1a1a;
        --text-primary: #e5e5e5;
        --text-secondary: #a0a0a0;
        --border-color: #2a2a2a;
        --border-light: #252525;
    }
    
    /* 다크모드에서 그림자 강도 조정 */
    :root {
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
        --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    }
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #000000;
        --text-secondary: #333333;
        --border-color: #000000;
    }
    
    .service-card {
        border: 2px solid #000000;
    }
    
    .btn {
        border: 2px solid #000000;
    }
}

/* === REDUCED MOTION === */
/* @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
} */

/* === LANDSCAPE ORIENTATION === */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding-top: 90px !important;
    }
    
    .combined-header {
        min-height: 56px;
    }
    
    .content-title {
        font-size: 1.75rem;
    }
}

/* === RESPONSIVE HELPER CLASSES === */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .show-mobile {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }
}

@media (min-width: 1025px) {
    .show-tablet {
        display: none !important;
    }
}