/* Reset some default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding: 20px;
    background-color: #f4f4f4;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h1, h2, h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #7E2367;
    font-family: Montserrat;
}

.search-form {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.search-row {
    display: flex;
    margin-bottom: 10px;
    align-items: center; 
}

/* Radio button styling with checkmark */
.search-type {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.search-type label {
    display: inline-flex;
    align-items: center;
    margin: 0 10px;
    cursor: pointer;
    font-size: 16px;
}

/* Style the actual radio input */
.search-radio {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    outline: none;
    margin-right: 10px;
    position: relative;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Create checkmark using ::before pseudo-element - adjusted position */
.search-radio::before {
    content: '';
    position: absolute;
    top: 3%;
    left: 30%;
    transform: rotate(45deg);
    width: 5px;
    height: 14px;
    border-bottom: 3px solid #f0f9f0;
    border-right: 3px solid #f0f9f0;
    opacity: 0;
    transition: all 0.2s ease;
}

/* On hover */
.search-radio:hover {
    border-color: #4CAF50;
    background-color: #f0f9f0;
}

/* When checked */
.search-radio:checked {
    border-color: #4CAF50;
    background-color: #4CAF50;
}

.search-radio:checked::before {
    opacity: 1;
}

/* Focus styles for accessibility */
.search-radio:focus {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

input, select, textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 10px;
}

.search-row input {
    flex: 1;
    border-radius: 4px 0 0 4px;
    height: 40px; 
    margin-bottom: 0;
}

button {
    padding: 10px 15px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.search-row button {
    border-radius: 0 4px 4px 0;
    height: 40px; /* Match input height */
    padding: 0 15px; /* Adjust padding */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

button:hover {
    background: #45a049;
}

#results {
    margin-top: 20px;
    padding: 15px;
    border-top: 1px solid #ddd;
}

/* Discreet admin link */
.admin-access {
    text-align: center;
    margin-top: 30px;
    font-size: 12px;
    color: #888;
}

.admin-access a {
    color: #86848421;
    text-decoration: none;
}

.admin-access a:hover {
    text-decoration: underline;
}

.panel {
    display: none;
}

.panel.active {
    display: block;
}

.admin-form {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-form label {
    display: flex;
    align-items: center;
}

.state-entry {
    background: #f9f9f9;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    border-left: 4px solid #4CAF50;
}

.error {
    color: red;
    font-weight: bold;
}

.success {
    color: green;
    font-weight: bold;
}

#login-form {
    max-width: 400px;
    margin: 0 auto;
}

#login-form input {
    width: 100%;
}

#login-form button {
    width: 100%;
    margin-top: 10px;
}

#admin-state-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
}

/* Image related styles */
.image-preview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: none;
}

.state-image {
    max-width: 100%;
    max-height: 200px;
    margin: 10px 0;
    border-radius: 4px;
}

.file-input-container {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input-container input[type=file] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-button {
    padding: 10px 15px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: inline-block;
}

.file-name {
    margin-top: 5px;
    font-size: 14px;
    color: #666;
}

.hidden {
    display: none;
}

.back-button {
    margin-bottom: 20px;
    color: #4CAF50;
    cursor: pointer;
    display: inline-block;
}

.back-button:hover {
    text-decoration: underline;
}

/* Sub-elements (People) styles */
.sub-elements {
    margin-top: 10px;
    border-top: 1px dashed #ddd;
    padding-top: 10px;
}

.sub-element {
    background: #f0f8f0;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: flex-start;
}

.person-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid #4CAF50;
}

.person-default-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-right: 15px;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #888;
    border: 2px solid #4CAF50;
}

.person-info {
    flex: 1;
}

.sub-element-actions {
    position: absolute;
    top: 5px;
    right: 5px;
}

.sub-element-actions button {
    padding: 2px 5px;
    font-size: 12px;
    margin-left: 5px;
}

.add-sub-element {
    margin-top: 10px;
    display: flex;
    gap: 5px;
}

.person-name {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 5px;
}

/* Admin sub-elements section */
.sub-elements-section {
    margin-top: 20px;
    border-top: 1px solid #ddd;
    padding-top: 15px;
}

.admin-sub-form {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    margin: 15px 0;
}

#admin-sub-elements-list {
    margin-top: 10px;
}

#toggle-admin-section {
    background: none;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    text-decoration: underline;
}

/* Person sub-element image preview */
.sub-image-preview {
    max-width: 100px;
    max-height: 100px;
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 50%;
    display: none;
}

/* Social media styles */
.social-media-container {
    margin-top: 10px;
}

.social-media-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    font-size: 16px;
}

.facebook { background-color: #3b5998; }
.twitter { background-color: #1da1f2; }
.instagram { background-color: #e1306c; }
.linkedin { background-color: #0077b5; }
.youtube { background-color: #ff0000; }
.tiktok { background-color: #000000; }

.social-inputs {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 5px;
    margin-top: 10px;
}

.social-inputs input {
    margin-bottom: 5px;
}

/* Person clickable styles */
.person-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.person-clickable:hover {
    background-color: #e7f3e7;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.view-details-button {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.person-clickable:hover .view-details-button {
    background-color: #45a049;
}

/* State clickable styles */
.state-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.state-clickable:hover {
    background-color: #e7f3e7;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.view-state-button {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 15px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.2s ease;
    text-align: center;
}

.state-clickable:hover .view-state-button {
    background-color: #45a049;
}

.sub-element-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 5px;
}

.sub-element-actions button {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
}

.edit-sub-element {
    background-color: #4285F4;
}

.edit-sub-element:hover {
    background-color: #3367D6;
}

.delete-sub-element {
    background-color: #EA4335;
}

.delete-sub-element:hover {
    background-color: #D62516;
}
/* Modern dropdown menu styles */
.select-container {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

.state-dropdown {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.state-dropdown:hover, .state-dropdown:focus {
    border-color: #CD9645;
    box-shadow: #CD9645;
}

.state-dropdown:focus {
    outline: none;
}

.select-arrow {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 0; 
    height: 0; 
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #204D60;
    pointer-events: none;
}

.search-button {
    width: 100%;
    padding: 12px;
    background: #CD9645;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: #CD9645;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

/* Dropdown option styling */
.state-dropdown option {
    padding: 10px;
    font-family: Montserrat;
    font-size: 16px;
    color: #CD9645;
}

/* Override existing styles for better spacing */
.search-form {
    margin-bottom: 30px;
}

/* Responsive adjustments */
@media (min-width: 600px) {
    .search-form {
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
}