/* Custom properties for Cyworld Autumn Acorn Theme */
:root {
    --cy-bg: #eddcb9; /* Warm autumn sandy beige */
    --cy-outer-bg: #8B4513; /* Acorn brown */
    --cy-primary: #e67e22; /* Maple orange */
    --cy-primary-hover: #d35400; /* Dark orange */
    --cy-accent: #CD853F; /* Light acorn brown */
    --cy-border-color: #bb9f7c;
    --cy-text-dark: #3a2e2b;
    --cy-text-light: #706050;
    --cy-light-beige: #faf6eb;
    
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--cy-bg);
    background-image: radial-gradient(var(--cy-border-color) 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--cy-text-dark);
    font-size: 13px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
}

a {
    color: var(--cy-primary);
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    color: var(--cy-primary-hover);
    text-decoration: underline;
}

/* Classic Cyworld Double-Border Frame Layout */
.cy-wrapper {
    width: 1080px;
    background-color: var(--cy-accent);
    border: 1px solid var(--cy-outer-bg);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 24px rgba(58, 46, 43, 0.2);
    position: relative;
    margin: auto;
}

/* Inner Frame Container */
.cy-container {
    background-color: var(--cy-light-beige);
    border: 1px dashed rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 680px;
    position: relative;
}

/* Header/Topbar inside the Cyworld frame */
.cy-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--cy-border-color);
    font-size: 12px;
    color: var(--cy-text-light);
}

.cy-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--cy-outer-bg);
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
}

.cy-title:hover {
    text-decoration: none !important;
}

.cy-stats {
    font-family: monospace;
    font-size: 11px;
    color: var(--cy-text-light);
}
.cy-stats .today {
    color: #e74c3c;
    font-weight: 700;
}
.cy-stats .total {
    color: var(--cy-text-dark);
}

/* Layout Main Body */
.cy-layout {
    display: flex;
    flex: 1;
    gap: 15px;
    position: relative;
}

/* Left Profile Column */
.cy-left-col {
    width: 220px;
    height: 100%;
    background: #ffffff;
    border: 1px solid var(--cy-border-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.cy-profile-img-wrapper {
    width: 100%;
    aspect-ratio: 1;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.cy-profile-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cy-profile-text {
    width: 100%;
    font-size: 12px;
    color: var(--cy-text-light);
    min-height: 80px;
    white-space: pre-wrap;
    border-top: 1px dashed var(--cy-border-color);
    padding-top: 10px;
}

.cy-profile-name {
    font-weight: 700;
    color: var(--cy-outer-bg);
    font-size: 14px;
}

.cy-pado-select {
    width: 100%;
    padding: 6px;
    font-size: 12px;
    border: 1px solid var(--cy-border-color);
    border-radius: 4px;
    background: #fff;
    color: var(--cy-text-dark);
}

/* Center Content Column Wrapper */
.cy-center-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

/* Center Content Column */
.cy-center-col {
    flex: 1;
    background: #ffffff;
    border: 1px solid var(--cy-border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cy-center-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Footer BGM player styles */
.cy-footer-bgm {
    background: #ffffff;
    border: 1px solid var(--cy-border-color);
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    font-size: 12px;
    color: var(--cy-text-light);
}

.cy-bgm-title {
    font-weight: 700;
    color: var(--cy-outer-bg);
    font-size: 12px;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tabs column sticking out of the right side */
.cy-tabs {
    position: absolute;
    right: -72px;
    top: 50px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}

.cy-tab {
    width: 72px;
    height: 38px;
    background: var(--cy-accent);
    color: #fff;
    border: 1px solid var(--cy-outer-bg);
    border-left: none;
    border-radius: 0 6px 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.cy-tab.active {
    background: #ffffff;
    color: var(--cy-outer-bg);
    width: 76px;
    border-right: 1px solid var(--cy-border-color);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.05);
}

.cy-tab:hover:not(.active) {
    background: var(--cy-primary);
    width: 75px;
}

/* Button & UI elements styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--cy-border-color);
    background: #fff;
    color: var(--cy-text-dark);
    transition: all 0.15s ease;
}

.btn-primary {
    background-color: var(--cy-primary);
    color: #fff;
    border-color: var(--cy-primary-hover);
}
.btn-primary:hover {
    background-color: var(--cy-primary-hover);
    color: #fff;
    text-decoration: none;
}

.btn-outline-light {
    border-color: var(--cy-border-color);
    background: #fff;
    color: var(--cy-text-dark);
}
.btn-outline-light:hover {
    background: var(--cy-light-beige);
    text-decoration: none;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
}

/* Cards (mapped from AWS style to Cyworld retro box style) */
.aws-card {
    background: #ffffff;
    border: 1px solid var(--cy-border-color);
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
}

.aws-card-header {
    padding: 10px 15px;
    border-bottom: 1px dashed var(--cy-border-color);
    background-color: var(--cy-light-beige);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.aws-card-header h2 {
    font-size: 13px;
    font-weight: 700;
    color: var(--cy-outer-bg);
}

.aws-card-body {
    padding: 15px;
}

/* Forms */
.form-group {
    margin-bottom: 12px;
}
.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
    font-size: 12px;
    color: var(--cy-text-dark);
}
.form-control {
    width: 100%;
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid var(--cy-border-color);
    border-radius: 4px;
    background: #ffffff;
    font-family: inherit;
    color: var(--cy-text-dark);
}
.form-control:focus {
    outline: none;
    border-color: var(--cy-primary);
    box-shadow: 0 0 0 1px var(--cy-primary);
}

/* Autoplay notification and alert */
.alert {
    padding: 8px 12px;
    font-size: 11px;
    border-radius: 4px;
    margin-bottom: 12px;
    border: 1px solid #ffcc80;
    background: #fff8e1;
    color: #e65100;
}

/* Search bar styling */
.cy-search-form {
    display: flex;
    gap: 4px;
}
.cy-search-input {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--cy-border-color);
    color: var(--cy-text-dark);
}

/* i18n select */
.lang-select {
    padding: 4px 6px;
    font-size: 11px;
    border: 1px solid var(--cy-border-color);
    border-radius: 4px;
    background: #fff;
    color: var(--cy-text-dark);
}


/* Iframe Layout Toggle & Resets */
#outer-frame, #inner-layout {
    display: none;
}

.is-top-level #outer-frame {
    display: block;
}

.is-iframe #inner-layout {
    display: flex;
}

/* Set scroll hide and full height when inside iframe */
html.is-iframe,
html.is-iframe body {
    background-color: transparent !important;
    background-image: none !important;
    min-height: auto !important;
    height: 100vh !important;
    width: 100vw !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

.is-iframe #inner-layout {
    height: 100vh !important;
    width: 100vw !important;
    box-sizing: border-box;
    padding-bottom: 3px;
}


/* Standalone Simple Layout (for authentication pages) */
.cy-auth-container {
    max-width: 440px;
    width: 100%;
    margin: 40px auto;
    padding: 0 15px;
}

.simple-layout-header {
    text-align: center;
    margin-bottom: 20px;
}

.simple-layout-header a {
    font-size: 28px;
    font-weight: 700;
    color: var(--cy-outer-bg);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
}
