* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10000;
    pointer-events: auto;
}

.navbar * {
    pointer-events: auto;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: #667eea;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
    pointer-events: auto;
    position: relative;
    z-index: 10001;
}

.nav-links a:hover {
    color: #667eea;
}

.navbar a {
    pointer-events: auto;
    position: relative;
    z-index: 10001;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    color: white;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
}

.btn-secondary:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.back-button {
    padding: 1rem 2.5rem;
    min-height: 48px;
    width: 100%;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.btn-kakao {
    background: #FEE500;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.btn-kakao:hover {
    background: #FDD835;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(253, 232, 53, 0.4);
}

.kakao-login {
    margin: 2rem 0;
}

.kakao-info {
    text-align: center;
    margin-top: 1rem;
    color: #666;
    font-size: 0.9rem;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 4rem 0;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.feature-card h2 {
    color: #667eea;
    margin-bottom: 1rem;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 2rem 0;
}

.auth-card {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
}

.auth-card h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

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

.date-input-group {
    display: flex;
    gap: 0.5rem;
}

.date-input-group select {
    flex: 1;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.time-input-group input[type="time"] {
    flex: 1;
    min-width: 150px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
    font-weight: normal;
    margin: 0;
    padding: 0;
    white-space: nowrap;
    line-height: 1;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #667eea;
    vertical-align: middle;
}

.checkbox-label span {
    user-select: none;
    font-size: 0.95rem;
    color: #555;
    line-height: 1;
    vertical-align: middle;
    margin-left: 0.3rem;
}

.form-group input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .time-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .time-input-group input[type="time"] {
        width: 100%;
    }
    
    .checkbox-label {
        width: 100%;
        justify-content: flex-start;
    }
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #fcc;
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Fortune Page */
.fortune-container {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin: 2rem 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.fortune-container h1 {
    color: #667eea;
    margin-bottom: 2rem;
    text-align: center;
}

.fortune-form {
    margin-bottom: 2rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-width: 300px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

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

.loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.loading-subtext {
    font-size: 0.9rem;
    color: #666;
}

/* 로딩 페이지 (전체 화면) */
.loading-page {
    min-height: calc(100vh - 200px);
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    margin-top: 2rem;
    position: relative;
    z-index: 0;
    pointer-events: none;
}

.loading-page .loading-content {
    pointer-events: auto;
}

.loading-page .loading-content {
    background: white;
    padding: 4rem 3rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
}

.loading-page .loading-spinner {
    width: 80px;
    height: 80px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

.loading-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.loading-subtitle {
    font-size: 1.1rem;
    color: #667eea;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.loading-description {
    font-size: 0.95rem;
    color: #666;
    margin-top: 1rem;
    line-height: 1.6;
}

.fortune-result {
    margin-top: 2rem;
    padding: 0;
    background: transparent;
    border: none;
}

.fortune-result h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.fortune-main-title {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    padding-left: 0;
}

.result-content {
    line-height: 1.8;
    color: #333;
    margin-bottom: 1rem;
    padding-left: 0;
    width: 100%;
}

.fortune-section-card {
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin-bottom: 2rem;
    box-shadow: none;
    border: none;
}

.fortune-section-header {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
    padding-left: 0;
}

.fortune-section-title {
    color: #333;
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding-left: 0;
    font-weight: 600;
}

.fortune-section-content {
    padding: 0;
    padding-left: 0;
    line-height: 1.8;
    text-align: left;
    color: #555;
}

.fortune-section-content p {
    margin-bottom: 1rem;
    padding-left: 0;
    text-indent: 0;
}

.fortune-section-content br {
    display: block;
    margin-bottom: 0.5rem;
}

.fortune-section-card h2,
.fortune-section-card h3 {
    padding-left: 0;
    margin-left: 0;
    text-indent: 0;
}

.fortune-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 2rem 0;
}

.fortune-list {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0;
}

.fortune-list-item {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #555;
}

.fortune-list-item::before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.result-content strong {
    color: #333;
    font-weight: 600;
}

/* MyPage */
.mypage-container {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin: 2rem 0;
}

.mypage-container h1 {
    color: #667eea;
    margin-bottom: 2rem;
}

.user-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 3rem;
}

.user-info h2 {
    color: #667eea;
    margin-bottom: 1rem;
}

.fortunes-list h2 {
    color: #667eea;
    margin-bottom: 1.5rem;
}

.fortunes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.fortune-card-link {
    text-decoration: none !important;
    color: inherit;
    display: block;
}

.fortune-card-link,
.fortune-card-link:hover,
.fortune-card-link:visited,
.fortune-card-link:active {
    text-decoration: none !important;
}

.fortune-card-link *,
.fortune-card-link:hover *,
.fortune-card-link:visited *,
.fortune-card-link:active * {
    text-decoration: none !important;
}

.fortune-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.fortune-card-link:hover .fortune-card {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.fortune-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.fortune-header h3 {
    color: #667eea;
    font-size: 1.2rem;
    text-decoration: none !important;
}

.fortune-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}

.fortune-date {
    color: #666;
    font-size: 0.9rem;
    text-decoration: none !important;
}

.fortune-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none !important;
}

.fortune-status.status-processing {
    background-color: #fff3cd;
    color: #856404;
}

.fortune-status.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.fortune-status.status-failed {
    background-color: #f8d7da;
    color: #721c24;
}

.fortune-info {
    margin-bottom: 1rem;
}

.fortune-info p {
    margin: 0.5rem 0;
    color: #555;
    text-decoration: none !important;
}

.fortune-card-link .fortune-header h3,
.fortune-card-link .fortune-date,
.fortune-card-link .fortune-info p,
.fortune-card-link .fortune-info strong {
    text-decoration: none !important;
}

.fortune-result-preview {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.no-fortunes {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

.no-fortunes a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
}

.fortune-result-full {
    white-space: pre-wrap;
    line-height: 1.8;
    color: #333;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: white;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links {
    margin-top: 0.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Privacy Page */
.privacy-container {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin: 2rem 0;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.privacy-container h1 {
    color: #667eea;
    margin-bottom: 1rem;
    text-align: center;
}

.last-updated {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.privacy-section {
    margin-bottom: 2.5rem;
}

.privacy-section h2 {
    color: #667eea;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.privacy-section p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 1rem;
}

.privacy-section ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.privacy-section li {
    line-height: 1.8;
    color: #555;
    margin-bottom: 0.5rem;
}

.privacy-section strong {
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .fortunes-grid {
        grid-template-columns: 1fr;
    }
    
    .fortune-container,
    .mypage-container {
        padding: 1.5rem;
    }
}
