/**
 * BUYMA Design System CSS
 * BUYMA風デザインシステムのメインスタイルシート
 */

/* CSS Variables (will be overridden by PHP if needed) */
:root {
    --buyma-red: #dc2626;
    --buyma-red-hover: #b91c1c;
    --buyma-red-light: #f87171;
    --buyma-black: #1f1f1f;
    --buyma-gray-dark: #4a5568;
    --buyma-gray: #718096;
    --buyma-gray-light: #e2e8f0;
    --buyma-white: #ffffff;
    
    --header-height: 120px;
    --nav-height: 60px;
    --sidebar-width: 280px;
    --container-max-width: 1200px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    --font-family-primary: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Arial", sans-serif;
    --font-family-secondary: "Inter", "Helvetica Neue", "Arial", sans-serif;
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-base: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --transition-base: all 0.2s ease-in-out;
    --transition-fast: all 0.15s ease-in-out;
    --transition-slow: all 0.3s ease-in-out;
}

/* Base Styles */
.buyma-page * {
    box-sizing: border-box;
}

.buyma-page {
    font-family: var(--font-family-primary) !important;
    background: #f8fafc !important;
    color: var(--buyma-black) !important;
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout */
.buyma-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header Styles */
.buyma-header {
    background: white;
    border-bottom: 3px solid var(--buyma-red);
    box-shadow: var(--shadow-base);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.buyma-header-top {
    background: var(--buyma-black);
    color: white;
    padding: 8px 0;
    font-size: 14px;
}

.buyma-header-main {
    padding: 15px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.buyma-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--buyma-red);
    text-decoration: none;
    transition: var(--transition-base);
}

.buyma-logo:hover {
    color: var(--buyma-red-hover);
    text-decoration: none;
}

.buyma-user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-balance {
    background: var(--buyma-red);
    color: white;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

/* Navigation Styles */
.buyma-navigation {
    background: white;
    border-bottom: 1px solid var(--buyma-gray-light);
    padding: 0;
}

.buyma-navigation .nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.buyma-navigation .nav-item {
    flex-shrink: 0;
}

.buyma-navigation .nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--buyma-gray-dark);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: var(--transition-base);
    white-space: nowrap;
    font-weight: 500;
}

.buyma-navigation .nav-link:hover {
    background: #f8fafc;
    color: var(--buyma-red);
    text-decoration: none;
}

.buyma-navigation .nav-item.current .nav-link {
    color: var(--buyma-red);
    border-bottom-color: var(--buyma-red);
    background: #fef2f2;
}

.buyma-navigation .nav-icon {
    margin-right: 8px;
    font-size: 16px;
}

/* Breadcrumb Styles */
.breadcrumb {
    margin-bottom: 20px;
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: var(--buyma-gray);
    text-decoration: none;
    transition: var(--transition-base);
}

.breadcrumb-item a:hover {
    color: var(--buyma-red);
    text-decoration: none;
}

.breadcrumb-item.current span {
    color: var(--buyma-black);
    font-weight: 500;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: var(--buyma-gray);
}

/* Main Content */
.buyma-main {
    flex: 1;
    padding: 30px 0;
    min-height: calc(100vh - var(--header-height) - 200px);
}

.page-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--buyma-gray-light);
}

.page-title {
    font-size: 32px;
    color: var(--buyma-black);
    margin: 0 0 10px 0;
    font-weight: 600;
    line-height: 1.2;
}

.page-description {
    color: var(--buyma-gray-dark);
    font-size: 18px;
    margin: 0;
    line-height: 1.5;
}

.page-content {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-base);
    margin-bottom: 30px;
}

/* Form Elements */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 16px;
    color: var(--buyma-black);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--buyma-gray-light);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition-base);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--buyma-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--buyma-red);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--buyma-red-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background: white;
    color: var(--buyma-gray-dark);
    border: 2px solid var(--buyma-gray-light);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--buyma-red);
    color: var(--buyma-red);
    text-decoration: none;
}

.btn i {
    margin-right: 8px;
}

.btn-lg {
    padding: 15px 32px;
    font-size: 16px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* Alert Styles */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fed7aa;
    color: #d97706;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
}

.alert-dismissible {
    padding-right: 50px;
}

.alert-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: var(--transition-base);
}

.alert-close:hover {
    opacity: 1;
}

/* Card Styles */
.card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-base);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--buyma-gray-light);
    background: #f8fafc;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--buyma-black);
}

.card-body {
    padding: 30px;
}

.card-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--buyma-gray-light);
    background: #f8fafc;
}

/* Table Styles */
.buyma-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.buyma-table th,
.buyma-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--buyma-gray-light);
}

.buyma-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--buyma-black);
    font-size: 14px;
}

.buyma-table td {
    font-size: 14px;
    color: var(--buyma-gray-dark);
}

.buyma-table tbody tr:hover {
    background: #f8fafc;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-badge.pending {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.processing {
    background: #dbeafe;
    color: #2563eb;
}

.status-badge.completed {
    background: #d1fae5;
    color: #059669;
}

.status-badge.failed {
    background: #fee2e2;
    color: #dc2626;
}

/* Footer Styles */
.buyma-footer {
    background: var(--buyma-black);
    color: white;
    padding: 40px 0;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h4 {
    color: var(--buyma-red);
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #cbd5e0;
    text-decoration: none;
    transition: var(--transition-base);
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--buyma-red);
    text-decoration: none;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.spinner {
    border: 2px solid var(--buyma-gray-light);
    border-top: 2px solid var(--buyma-red);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .buyma-container {
        padding: 0 15px;
    }
    
    .buyma-header-main {
        flex-direction: column;
        gap: 15px;
        padding: 10px 0;
    }
    
    .buyma-user-menu {
        gap: 10px;
        font-size: 14px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .buyma-navigation .nav-list {
        justify-content: flex-start;
    }
    
    .buyma-navigation .nav-link {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .page-content {
        padding: 20px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .page-description {
        font-size: 16px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }
    
    .card-body,
    .card-header,
    .card-footer {
        padding: 20px;
    }
    
    .buyma-table {
        font-size: 12px;
    }
    
    .buyma-table th,
    .buyma-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .buyma-navigation .nav-link {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .nav-icon {
        display: none;
    }
    
    .page-content {
        padding: 15px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.d-none { display: none; }
.d-flex { display: flex; }
.d-block { display: block; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* Animation Utilities */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

.slide-down {
    animation: slideDown 0.3s ease-in-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}