/* ===========================================
   SHARED DESIGN SYSTEM - Lion's Wrath Builders
   Main design language based on recipe-builder.css
   =========================================== */

/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #0f0e0d 0%, #1a1815 100%);
    color: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
}

/* CONTAINER & LAYOUT */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(30, 27, 25, 0.95);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    position: relative;
}

/* HEADER */
.header {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(212, 175, 55, 0.05) 100%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding: 50px 40px;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 2.8em;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffd700;
    letter-spacing: 0.5px;
}

.header p {
    color: #bdbdbd;
    font-size: 1em;
    font-weight: 300;
    letter-spacing: 0.3px;
}

/* CONTENT & SECTIONS */
.content {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 40px;
    padding: 40px;
}

.section {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    backdrop-filter: blur(5px);
}

.section h2 {
    font-size: 1.6em;
    margin-bottom: 25px;
    color: #ffd700;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, #ffd700, #d4af37);
    border-radius: 2px;
}

/* FORM ELEMENTS */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    margin-bottom: 10px;
    color: #e8e8e8;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 0.85em;
}

input[type="text"],
input[type="color"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
    padding: 12px 14px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    font-size: 0.95em;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.05);
    color: #f5f5f5;
    transition: all 0.3s ease;
}

input[type="text"]:hover,
input[type="color"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="file"]:hover,
select:hover,
textarea:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(212, 175, 55, 0.5);
}

input[type="text"]:focus,
input[type="color"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="file"]:focus,
textarea:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffd700' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

select option {
    background: #1e1b19;
    color: #f5f5f5;
}

select:focus {
    outline: none;
    border-color: #ffd700;
    background-color: rgba(255, 255, 255, 0.08);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffd700' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* BUTTONS */
button {
    padding: 12px 20px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9em;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1));
    color: #ffd700;
    border-color: #ffd700;
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.35), rgba(212, 175, 55, 0.25));
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.25);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #e8e8e8;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ff6b6b;
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ff6b6b;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.2);
    transform: translateY(-2px);
}

.btn-small {
    padding: 7px 12px;
    font-size: 0.85em;
}

/* MESSAGES & ALERTS */
.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ff6b6b;
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #ff6b6b;
    animation: slideIn 0.3s ease;
}

.success {
    background: rgba(74, 222, 128, 0.2);
    color: #86efac;
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #86efac;
    animation: slideIn 0.3s ease;
}

.info {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #93c5fd;
    animation: slideIn 0.3s ease;
}

.message {
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

/* ANIMATIONS */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* PAINT/ITEM CARDS */
.paint-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.paint-item:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateX(4px);
}

.paint-preview {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    margin-right: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.paint-info {
    flex: 1;
}

.paint-name {
    font-weight: 600;
    color: #f5f5f5;
    font-size: 0.95em;
}

.paint-hex {
    font-size: 0.85em;
    color: #a0a0a0;
    font-family: 'Courier New', monospace;
    margin-top: 4px;
}

.paint-list {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.paint-list::-webkit-scrollbar {
    width: 6px;
}

.paint-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.paint-list::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}

.paint-list::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

.paint-search-container {
    position: relative;
    margin-bottom: 20px;
}

.paint-search-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    font-size: 0.95em;
    background: rgba(255, 255, 255, 0.05);
    color: #f5f5f5;
    transition: all 0.3s ease;
}

.paint-search-input::placeholder {
    color: #707070;
}

.paint-search-input:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.paint-count {
    font-size: 0.85em;
    color: #a0a0a0;
    margin-bottom: 10px;
    text-align: right;
}

/* STEPS & COLOR GROUPS */
.step {
    background: rgba(255, 255, 255, 0.04);
    padding: 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    transition: all 0.3s ease;
}

.step:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(212, 175, 55, 0.2);
}

.step h4 {
    margin-bottom: 16px;
    color: #ffd700;
    font-size: 1.1em;
    font-weight: 600;
}

.color-group {
    background: rgba(0, 0, 0, 0.3);
    padding: 14px;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.color-item {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.color-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.color-item:last-child {
    margin-bottom: 0;
}

.color-preview-small {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ratio-input {
    width: 70px;
}

/* SEARCH RESULTS */
.search-results {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.3);
}

.search-result-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 12px;
    align-items: center;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: rgba(212, 175, 55, 0.15);
}

.search-result-color {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.search-result-text {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-weight: 600;
    color: #f5f5f5;
}

.search-result-hex {
    font-size: 0.8em;
    color: #888;
    font-family: monospace;
}

/* MODALS */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal {
    background: #1e1b19;
    border-radius: 10px;
    padding: 32px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.2);
    animation: slideUp 0.3s ease;
}

.modal h3 {
    margin-bottom: 20px;
    color: #ffd700;
    font-size: 1.4em;
    font-weight: 700;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-buttons button {
    flex: 1;
}

/* LOGIN */
.login-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(15, 14, 13, 0.95), rgba(26, 24, 21, 0.95));
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.login-overlay.active {
    display: flex;
}

.login-box {
    background: rgba(30, 27, 25, 0.95);
    border-radius: 10px;
    padding: 50px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.2);
    text-align: center;
    backdrop-filter: blur(10px);
}

.login-box h2 {
    margin-bottom: 12px;
    color: #ffd700;
    font-size: 1.8em;
    font-weight: 700;
}

.login-box p {
    color: #a0a0a0;
    margin-bottom: 32px;
    font-size: 0.95em;
}

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

.login-form input[type="password"] {
    padding: 12px 14px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    font-size: 0.95em;
    background: rgba(255, 255, 255, 0.05);
    color: #f5f5f5;
    transition: all 0.3s ease;
}

.login-form input[type="password"]:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    flex: 1;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #ffd700;
    font-size: 1.3em;
    padding: 0;
    width: 35px;
    transition: transform 0.2s ease;
}

.toggle-password:hover {
    transform: scale(1.1);
}

.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 18px;
    background: rgba(239, 68, 68, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: none;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ff6b6b;
    transform: translateY(-2px);
}

.content.hidden {
    display: none;
}

/* PAINT TYPE BADGES & INDICATORS */
.paint-type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.paint-type-normal {
    background: rgba(100, 150, 255, 0.2);
    color: #64b5ff;
    border: 1px solid rgba(100, 150, 255, 0.4);
}

.paint-type-metallic {
    background: rgba(200, 180, 80, 0.2);
    color: #ffd700;
    border: 1px solid rgba(200, 180, 80, 0.4);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.paint-type-contrast {
    background: rgba(255, 100, 150, 0.2);
    color: #ff6496;
    border: 1px solid rgba(255, 100, 150, 0.4);
}

.paint-type-shade {
    background: rgba(100, 100, 100, 0.3);
    color: #b0b0b0;
    border: 1px solid rgba(100, 100, 100, 0.5);
}

/* IMAGE PREVIEW */
.image-preview {
    width: 100%;
    border-radius: 8px;
    border: 2px solid rgba(212, 175, 55, 0.2);
    object-fit: cover;
    margin-top: 12px;
}

.image-preview-container {
    position: relative;
    margin-top: 12px;
}

.remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.remove-image-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.05);
}

/* TAGS/CHECKBOXES */
.tag-item {
    background: rgba(255, 255, 255, 0.04);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.tag-item:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateX(4px);
}

.tag-name {
    font-weight: 600;
    color: #e0e0e0;
}

.tag-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.tag-checkbox {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s;
    color: #ddd;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tag-checkbox input {
    cursor: pointer;
}

.tag-checkbox:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #d4af37;
}

.tag-checkbox input:checked {
    accent-color: #d4af37;
}

.selected-tag {
    background: rgba(212, 175, 55, 0.3);
    border: 1px solid #d4af37;
    border-radius: 8px;
    padding: 6px 10px;
    color: #d4af37;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.selected-tag:hover {
    background: rgba(212, 175, 55, 0.4);
}

.selected-tag .remove-tag {
    cursor: pointer;
    margin-left: 4px;
    font-weight: bold;
}

.selected-tag .remove-tag:hover {
    color: #fff;
}

/* LAYOUT BUILDER SPECIFIC */
.layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.layout-item {
    position: relative;
    cursor: grab;
    transition: all 0.3s;
}

.layout-item:active {
    cursor: grabbing;
}

.layout-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.layout-item.drag-over {
    transform: scale(1.05);
}

.layout-item-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s;
}

.layout-item:hover .layout-item-thumbnail {
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.layout-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.layout-item-order {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(212, 175, 55, 0.9);
    color: #1e1b19;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
}

.layout-item-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.8));
    color: #fdfdfd;
    padding: 12px 8px 8px 8px;
    font-size: 12px;
    text-align: center;
    word-break: break-word;
}

.layout-item-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(244, 67, 54, 0.9);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.3s;
    z-index: 20;
}

.layout-item:hover .layout-item-delete {
    opacity: 1;
}

.layout-item-delete:hover {
    background: rgba(211, 47, 47, 1);
    transform: scale(1.1);
}

.control-section {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(221, 221, 221, 0.5);
}

.empty-state h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: rgba(221, 221, 221, 0.7);
}

.info-message {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    color: #93c5fd;
    font-size: 0.95em;
}

/* RESPONSIVE */
@media (max-width: 1000px) {
    .content {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .layout-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .header {
        padding: 30px 20px;
    }

    .content {
        padding: 20px;
        gap: 20px;
    }

    .control-section {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    button {
        padding: 10px 16px;
        font-size: 0.9em;
    }
}
