/* Color mapping for elements */
:root {
    --color-element-1: rgb(92, 92, 92);      /* Gray */
    --color-element-2: rgb(32, 169, 38);     /* Green */
    --color-element-3: rgb(0, 0, 0);         /* Black */
    --color-element-4: rgb(255, 0, 0);       /* Red */
    --color-element-5: rgb(255, 138, 0);     /* Orange */
}

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

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
}

.app-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.chart-wrapper {
    background-color: rgb(233, 233, 223);
    padding: 2px;
    width: 680.4px;
    height: 916px;
}

.chart-container {
    padding: 2px;
    position: relative;
    width: 712px;
    height: 960px;
    transform: scale(0.95);
    transform-origin: left top;
}

.palaces-grid {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Palace cell styling */
.palace-cell {
    width: 178px;
    height: 240px;
    border: 1px solid #333;
    background-color: white;
    padding: 8px;
    overflow: hidden;
}

.palace-header {
    display: flex;
    font-weight: bold;
    margin-bottom: 8px;
}

.palace-stem {
    font-size: 11px;
    width: 25%;
    flex-shrink: 0;
}

.palace-name {
    font-size: 10px;
    width: 50%;
    text-align: center;
    text-transform: uppercase;
    padding-top: 2px;
}

.palace-age {
    font-size: 11px;
    width: 25%;
    text-align: right;
}

.palace-main-stars {
    height: 26px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.main-star {
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
}

.palace-secondary-stars {
    font-size: 10px;
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.stars-column {
    flex: 1;
}

.star-item {
    line-height: 1.4;
    margin-bottom: 2px;
}

.star-name {
    font-weight: 500;
}

.star-name.bold {
    font-weight: bold;
}

/* Special markers */
.special-marker {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.marker-badge {
    background-color: black;
    color: white;
    font-weight: bold;
    padding: 2px 8px;
    display: inline-block;
    font-size: 12px;
}

/* Palace footer */
.palace-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 178px;
    display: flex;
    font-size: 9px;
    font-weight: 500;
    padding: 4px;
}

.footer-zodiac {
    width: 30%;
    text-align: left;
}

.footer-life-stage {
    width: 40%;
    text-align: center;
    font-weight: bold;
    font-size: 10px;
}

.footer-month {
    width: 30%;
    text-align: right;
}

/* Palace relationships */
.palace-relationships {
    position: absolute;
    bottom: 18px;
    left: 0;
    width: 178px;
    display: flex;
    font-size: 9.5px;
    font-weight: 700;
    padding: 4px;
}

.relationship-left {
    width: 50%;
    text-align: left;
}

.relationship-right {
    width: 50%;
    text-align: right;
}

/* Grid positioning - 4 rows x 3 columns */
/* Palace 1: bottom-left */
.palace-1 { position: absolute;     top: 720px;; left: 0px; }

/* Palace 2: middle-left (row 2) */
.palace-2 { position: absolute; bottom: 240px; left: 0px; border-bottom: none; }

/* Palace 3: middle-left (row 3) */
.palace-3 { position: absolute; bottom: 480px; left: 0px; border-bottom: none; border-top: none; }

/* Palace 4: top-left */
.palace-4 { position: absolute; bottom: 720px; left: 0px; }

/* Palace 5: middle-left (row 4) */
.palace-5 { position: absolute; bottom: 720px; left: 178px; border-left: none; }

/* Palace 6: middle-center (row 3) */
.palace-6 { position: absolute; bottom: 720px; left: 356px; border-left: none; border-right: none; }

/* Palace 7: middle-right (row 4) */
.palace-7 { position: absolute; bottom: 720px; left: 534px; }

/* Palace 8: middle-right (row 2) */
.palace-8 { position: absolute; top: 240px; left: 534px; border-top: none; }

/* Palace 9: middle-right (row 3) */
.palace-9 { position: absolute; top: 480px; left: 534px; border-top: none; border-bottom: none; }

/* Palace 10: top-right (row 4) */
.palace-10 { position: absolute; top: 720px; left: 534px; }

/* Palace 11: bottom-center-right */
.palace-11 { position: absolute;     top: 720px;; right: 353px; border-right: none; }

/* Palace 12: bottom-center */
.palace-12 { position: absolute;     top: 720px; right: 173px; border-right: 1px solid #333; border-left: 1px solid #333; }

/* Center cells - User info and chart details */
.center-cells {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 352px;
    height: 480px;
    display: flex
;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 10;
    overflow: hidden;
}

.center-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    padding: 15px;
    overflow-y: auto;
    font-size: 11px;
}

.center-title {
    font-size: 21px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 5px;
    color: #333;
    text-transform: uppercase;
}

.center-subtitle {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    color: #333;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.center-website {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 10px;
}

.center-website a {
    color: blue;
    text-decoration: none;
}

.center-website a:hover {
    text-decoration: underline;
}

.center-section {
    width: 100%;
    margin-bottom: 8px;
}

.center-row {
    display: grid;
    grid-template-columns: 60px 1fr 60px 1fr;
    gap: 5px;
    margin-bottom: 4px;
    align-items: center;
    font-size: 11px;
}

.center-row-full {
    width: 100%;
    margin-bottom: 4px;
    text-align: center;
}

.center-label {
    font-weight: bold;
    text-align: left;
    color: #333;
}

.center-value {
    color: #0066cc;
    text-align: left;
}

.center-value-stem {
    color: #0066cc;
    text-align: left;
    font-size: 10px;
}

.center-divider {
    width: 100%;
    height: 1px;
    background-color: #ccc;
    margin: 8px 0;
}

/* Form Styling */
.app-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.form-section {
    width: 100%;
}

.form-container {
    background-color: #0f1419;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    margin: 0 auto;
}

.form-title {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

.form-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.form-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.horoscope-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group-half {
    flex: 1;
}

.form-group-third {
    flex: 1;
}

.form-row-2 {
    display: flex;
    gap: 12px;
}

.form-row-3 {
    display: flex;
    gap: 12px;
}

.form-label {
    color: #8b92a9;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-label {
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
}

.form-input,
.form-select {
    background-color: #1a1f2e;
    color: #e0e0e0;
    border: 1px solid #2a3142;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #4a5568;
    background-color: #1f2535;
}

.form-input::placeholder {
    color: #6b7280;
}

/* Gender Selection */
.form-gender-group {
    display: flex;
    gap: 12px;
}

.form-gender-btn {
    flex: 1;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1f2e;
    color: #e0e0e0;
    border: 1px solid #2a3142;
    border-radius: 8px;
    padding: 12px 14px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-gender-btn input[type="radio"] {
    display: none;
}

.form-gender-btn span:first-of-type {
    flex: 1;
}

.gender-check {
    display: none;
    color: #4a9d6f;
    font-size: 18px;
    font-weight: bold;
    margin-left: 8px;
}

.form-gender-btn input[type="radio"]:checked ~ .gender-check {
    display: block;
}

.form-gender-btn:has(input[type="radio"]:checked) {
    border-color: #4a9d6f;
}

/* Calendar Selection */
.form-calendar-group {
    display: flex;
    gap: 12px;
}

.form-calendar-btn {
    flex: 1;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #1a1f2e;
    color: #8b92a9;
    border: 1px solid #2a3142;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-calendar-btn input[type="radio"] {
    display: none;
}

.calendar-icon {
    font-size: 16px;
}

.form-calendar-btn input[type="radio"]:checked ~ .calendar-icon {
    color: #1a1f2e;
}

.form-calendar-btn input[type="radio"]:checked ~ span {
    color: #1a1f2e;
}

.form-calendar-btn input[type="radio"]:checked {
    background-color: #f5f5f5;
    border-color: #f5f5f5;
}

/* Apply checked state to label when radio is checked */
.form-calendar-btn:has(input[type="radio"]:checked) {
    background-color: #f5f5f5;
    border-color: #f5f5f5;
    color: #1a1f2e;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #e0e0e0;
    font-size: 14px;
    user-select: none;
}

.form-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #ffd700;
}

.form-submit-btn {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: #1a1f2e;
    border: none;
    border-radius: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.form-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(255, 193, 7, 0.4);
}

.form-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.chart-section {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        gap: 30px;
        padding: 10px;
    }

    .form-container {
        padding: 20px;
        max-width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group-half {
        width: 100%;
    }

    .form-radio-group {
        flex-direction: column;
    }

    .chart-wrapper {
        width: 100%;
        height: auto;
    }
}

