﻿/* Admin Dashboard Styles */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

    .admin-header h1 {
        font-size: 2rem;
        font-weight: 700;
        color: #111827;
    }

.admin-header-actions {
    display: flex;
    gap: 1rem;
}

/* Tabs */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
    overflow-x: auto;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
    white-space: nowrap;
}

    .tab-button:hover {
        color: #111827;
    }

    .tab-button.active {
        color: #111827;
        border-bottom-color: #111827;
    }

/* Tab Content */
.tab-content {
    display: none;
}

    .tab-content.active {
        display: block;
    }

/* Cards */
.admin-card {
    background: #faf6f3;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(61, 48, 41, 0.08);
    margin-bottom: 2rem;
    border: 1px solid #e8d5c4;
}

/* Enhanced Theme Section Styles */
.theme-section {
    background: #fafbfc;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid #3b82f6;
}

.theme-section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.theme-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-section-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.5rem 0 0 0;
}

.theme-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.theme-control-group {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.theme-control-group:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.theme-control-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    display: block;
    font-size: 0.875rem;
}


    .admin-card h2 {
        font-size: 1.5rem;
        font-weight: 600;
        margin-bottom: 1.5rem;
        color: #111827;
    }

.card-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.card-header-with-action > div {
    flex: 1;
}

.card-header-with-action > button {
    flex-shrink: 0;
    align-self: flex-start;
}

.card-header-with-action h2 {
    margin-bottom: 0.5rem;
}

.card-header-with-action .form-group {
    margin-bottom: 0;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

    .form-group label {
        display: block;
        font-weight: 500;
        margin-bottom: 0.5rem;
        color: #374151;
    }

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

    .form-control:focus {
        outline: none;
        border-color: #111827;
    }

select.form-control {
    cursor: pointer;
    background-color: white;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

textarea.form-control {
    resize: vertical;
    font-family: inherit;
}

/* Input with Prefix */
.input-with-prefix {
    display: flex;
    align-items: center;
}

.input-prefix {
    background: #f3f4f6;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: #6b7280;
}

.input-with-prefix .form-control {
    border-radius: 0 8px 8px 0;
}

/* Radio/Checkbox */
.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

    .radio-label input,
    .checkbox-label input {
        width: 18px;
        height: 18px;
        cursor: pointer;
    }

/* Avatar Preview */
.avatar-preview {
    margin: 1rem 0;
}

    .avatar-preview img {
        width: 120px;
        height: 120px;
        border-radius: 50%;
        object-fit: cover;
        border: 3px solid #e5e7eb;
    }

/* Color Picker */
.color-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-picker {
    width: 60px;
    height: 48px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
}

.color-text {
    flex: 1;
}

/* Range Slider */
.form-range {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
}

    .form-range::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 20px;
        height: 20px;
        background: #111827;
        border-radius: 50%;
        cursor: pointer;
    }

    .form-range::-moz-range-thumb {
        width: 20px;
        height: 20px;
        background: #111827;
        border-radius: 50%;
        cursor: pointer;
        border: none;
    }

.range-value {
    display: inline-block;
    margin-left: 0.5rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #111827;
    color: white;
}

    .btn-primary:hover {
        background: #1f2937;
    }

.btn-secondary {
    background: #f3f4f6;
    color: #111827;
}

    .btn-secondary:hover {
        background: #e5e7eb;
    }

.btn-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #111827;
}

    .btn-outline:hover {
        background: #f3f4f6;
    }

.btn-logout {
    background: transparent;
    border: 1px solid #d4a387;
    color: #8b4513;
}

    .btn-logout:hover {
        background: #F2BFA4;
        border-color: #c89370;
        color: #6b3410;
    }

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

    .btn-icon:hover {
        background: #f3f4f6;
    }

.btn-danger {
    color: white;
}

    .btn-danger:hover {
        background: #b91c1c;
        color: white;
    }

/* Link Lists Container */
.link-lists-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff9f5;
    border: 1px solid #e8d5c4;
    border-radius: 8px;
    transition: box-shadow 0.2s;
}

    .list-item:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

.list-drag-handle {
    cursor: grab;
    color: #9ca3af;
}

    .list-drag-handle:active {
        cursor: grabbing;
    }

.list-info {
    flex: 1;
}

.list-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.list-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.list-stats {
    font-size: 0.875rem;
    color: #6b7280;
}

.list-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Links List */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff9f5;
    border: 1px solid #e8d5c4;
    border-radius: 8px;
    transition: box-shadow 0.2s;
}

    .link-item:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

.link-drag-handle {
    cursor: grab;
    color: #9ca3af;
}

    .link-drag-handle:active {
        cursor: grabbing;
    }

.link-info {
    flex: 1;
}

.link-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.link-url {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.link-stats {
    font-size: 0.875rem;
    color: #6b7280;
}

.link-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

    .toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 24px;
}

    .toggle-slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.3s;
        border-radius: 50%;
    }

input:checked + .toggle-slider {
    background-color: #111827;
}

    input:checked + .toggle-slider:before {
        transform: translateX(24px);
    }


/* Social Links Grid */
.social-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.social-link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff9f5;
    border: 1px solid #e8d5c4;
    border-radius: 8px;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .social-icon svg {
        width: 24px;
        height: 24px;
    }

.social-info {
    flex: 1;
}

.social-platform {
    font-weight: 600;
    color: #111827;
}

.social-url {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Analytics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff9f5;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e8d5c4;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.top-links-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.top-link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #fff9f5;
    border-radius: 8px;
    border: 1px solid #e8d5c4;
}

.top-link-title {
    font-weight: 600;
    color: #111827;
}

.top-link-url {
    font-size: 0.875rem;
    color: #6b7280;
}

.top-link-clicks {
    font-weight: 600;
    color: #111827;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

    .modal.active {
        display: flex;
        align-items: center;
        justify-content: center;
    }

.modal-content {
    background: #faf6f3;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #e8d5c4;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

    .modal-header h3 {
        font-size: 1.25rem;
        font-weight: 600;
        color: #111827;
    }

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    transition: background 0.2s;
}

    .modal-close:hover {
        background: #f3f4f6;
    }

.modal-body {
    padding: 1.5rem;
}

.modal-content form {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.empty-state {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
}

/* Custom Button Elements */
.button-elements-container {
    margin-bottom: 1rem;
}

.button-element-item {
    background: #fff9f5;
    border: 1px solid #e8d5c4;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.button-element-item .form-group {
    margin-bottom: 0.75rem;
}

.button-element-item .form-group:last-child {
    margin-bottom: 0;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Background Image Upload */
.bg-image-preview {
    margin: 1rem 0;
}

.bg-preview-container {
    width: 100%;
    height: 150px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #f9fafb;
}

.bg-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bg-preview-placeholder {
    text-align: center;
    color: #6b7280;
    padding: 1rem;
}

.bg-preview-placeholder svg {
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.bg-preview-placeholder p {
    margin: 0;
    font-size: 0.875rem;
}

/* Image Processing States */
.bg-processing {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.processing-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.bg-processing p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Enhanced Form Controls */
.enhanced-color-picker {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.enhanced-color-picker:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.enhanced-color-picker input[type="color"] {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.enhanced-range-input {
    position: relative;
    padding: 1rem 0;
}

.enhanced-range-input input[type="range"] {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.enhanced-range-input input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    transition: all 0.2s ease;
}

.enhanced-range-input input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.enhanced-range-value {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: 0.5rem;
    min-width: 60px;
    text-align: center;
}

.collapsible-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin: 1rem 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.collapsible-header {
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.collapsible-header:hover {
    background: #f1f5f9;
}

.collapsible-content {
    padding: 1.25rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.collapsible-section.expanded .collapsible-content {
    max-height: 1000px;
    padding: 1.25rem;
}

.collapsible-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #e2e8f0;
    transition: transform 0.3s ease;
}

.collapsible-section.expanded .collapsible-toggle {
    transform: rotate(180deg);
}

/* Responsive Improvements */
@media (max-width: 1024px) {
    .admin-container {
        padding: 1rem;
    }

    .theme-controls-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .theme-preview {
        display: none;
    }
}

@media (max-width: 768px) {
    .admin-container {
        padding: 0.75rem;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .admin-header-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .admin-header-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .admin-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .admin-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .social-links-grid {
        grid-template-columns: 1fr;
    }

    .card-header-with-action {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .card-header-with-action > button {
        align-self: stretch;
        margin-top: 0.5rem;
    }

    .theme-section {
        margin: 1rem 0;
        padding: 1rem;
    }

    .theme-controls-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .enhanced-color-picker {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .enhanced-color-picker input[type="color"] {
        width: 40px;
        height: 40px;
    }

    .link-item,
    .list-item {
        flex-wrap: wrap;
        padding: 0.75rem;
    }

    .link-actions,
    .list-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
    }

    .button-element-item {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }

    .button-element-item .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .admin-container {
        padding: 0.5rem;
    }

    .admin-card {
        padding: 1rem;
    }

    .theme-section {
        margin: 1.5rem 0;
        padding: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .tab-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Inner content will be rebuilt from scratch */

