/* ════════════════════════════════════════════════════════════════ */
/* STACKFOLIO v2 — REFACTORED STYLES */
/* ════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════ */
/* OWNER CONTROL BAR */
/* ════════════════════════════════════════════════════════════════ */
.owner-bar {
    position: fixed;
    z-index: 45;
    background:
        radial-gradient(circle at 10% 0%, rgba(14, 116, 144, 0.2) 0%, transparent 45%),
        radial-gradient(circle at 95% 0%, rgba(56, 189, 248, 0.12) 0%, transparent 42%),
        linear-gradient(180deg, rgba(10, 12, 16, 0.96) 0%, rgba(10, 12, 16, 0.92) 100%);
    color: white;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 242, 255, 0.15);
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.owner-frame {
    position: relative;
    padding-top: 46px;
}

.owner-toggle-anchor {
    position: absolute;
    top: 0;
    right: 24px;
    z-index: 2;
}

.owner-studio-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(0, 242, 255, 0.35);
    border-radius: 9999px;
    padding: 6px 12px;
    background: rgba(0, 242, 255, 0.1);
    color: #67e8f9;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.owner-studio-toggle-btn:hover {
    background: rgba(0, 242, 255, 0.18);
    border-color: rgba(0, 242, 255, 0.55);
}

.owner-bar.collapsed .owner-shell {
    display: none;
}

.owner-bar.collapsed {
    padding-bottom: 8px;
}

.owner-shell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border: 1px solid rgba(0, 242, 255, 0.16);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(10, 12, 16, 0.78) 0%, rgba(13, 22, 34, 0.72) 100%);
}

.owner-left,
.owner-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.owner-left {
    flex-direction: column;
    align-items: flex-start;
}

.owner-kicker {
    font-size: 10px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #67e8f9;
}

.owner-subtitle {
    font-size: 12px;
    color: rgba(230, 237, 243, 0.65);
    line-height: 1.2;
}

.owner-mode-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.owner-right {
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 8px;
}

.owner-actions,
.owner-session {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border: 1px solid rgba(0, 242, 255, 0.18);
    border-radius: 10px;
    background: rgba(0, 242, 255, 0.05);
}

.owner-session {
    position: relative;
}

.owner-settings-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    z-index: 60;
    padding: 8px;
    border: 1px solid rgba(0, 242, 255, 0.25);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(12, 18, 24, 0.98) 0%, rgba(9, 14, 20, 0.98) 100%);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
}

.owner-settings-menu.hidden {
    display: none !important;
}

.owner-settings-extra {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 6px;
}

.owner-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(0, 242, 255, 0.2);
    border-radius: 8px;
    padding: 8px 10px;
    background: rgba(0, 242, 255, 0.08);
    color: #bae6fd;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.owner-menu-item:hover {
    background: rgba(0, 242, 255, 0.14);
    border-color: rgba(0, 242, 255, 0.45);
}

.owner-menu-item.danger {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
}

.owner-menu-item.danger:hover {
    border-color: rgba(239, 68, 68, 0.55);
    background: rgba(239, 68, 68, 0.24);
}

/* ════════════════════════════════════════════════════════════════ */
/* TOGGLE, SAVE & SHARE BUTTONS */
/* ════════════════════════════════════════════════════════════════ */
.toggle-btn,
.save-btn,
.share-btn,
.discard-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 242, 255, 0.35);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    gap: 6px;
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.12) 0%, rgba(0, 153, 204, 0.1) 100%);
    color: #67e8f9;
    box-shadow: 0 3px 10px rgba(0, 242, 255, 0.14);
    min-height: 34px;
}

.toggle-btn {
    border-color: rgba(0, 242, 255, 0.5);
}

.toggle-btn:hover {
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.22) 0%, rgba(0, 153, 204, 0.2) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 242, 255, 0.28);
}

.save-btn {
    border-color: rgba(34, 197, 94, 0.55);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18) 0%, rgba(22, 163, 74, 0.14) 100%);
    color: #86efac;
}

.save-btn:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.28) 0%, rgba(22, 163, 74, 0.22) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3);
}

.discard-btn {
    border-color: rgba(248, 113, 113, 0.5);
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.16) 0%, rgba(220, 38, 38, 0.12) 100%);
    color: #fecaca;
}

.discard-btn:hover {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.25) 0%, rgba(220, 38, 38, 0.2) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(248, 113, 113, 0.28);
}

.save-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.share-btn {
    border-color: rgba(0, 242, 255, 0.35);
}

.share-btn:hover {
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.2) 0%, rgba(0, 153, 204, 0.18) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 242, 255, 0.24);
}

.share-btn.hidden {
    display: none !important;
}

.section-delete-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 15;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(239, 68, 68, 0.55);
    border-radius: 9999px;
    padding: 6px 10px;
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.section-delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.8);
    color: #fecaca;
}

.section-delete-btn.hidden {
    display: none !important;
}

.hidden-sections-panel {
    display: none;
    align-items: stretch;
    gap: 6px;
    flex-direction: column;
}

.restore-section-btn {
    border: 1px solid rgba(34, 197, 94, 0.45);
    border-radius: 9999px;
    padding: 5px 10px;
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.restore-section-btn:hover {
    background: rgba(34, 197, 94, 0.22);
    border-color: rgba(34, 197, 94, 0.7);
}

.app-toast {
    position: fixed;
    right: 18px;
    bottom: 22px;
    z-index: 70;
    max-width: min(360px, calc(100vw - 32px));
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 242, 255, 0.35);
    background: rgba(7, 16, 22, 0.95);
    color: #e6f6ff;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.app-toast.hidden {
    display: none !important;
}

.app-toast.success {
    border-color: rgba(34, 197, 94, 0.45);
}

.app-toast.error {
    border-color: rgba(239, 68, 68, 0.5);
}

/* ════════════════════════════════════════════════════════════════ */
/* EDIT BANNER */
/* ════════════════════════════════════════════════════════════════ */
.edit-banner {
    font-size: 11px;
    opacity: 0.95;
    color: #67e8f9;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid rgba(0, 242, 255, 0.35);
    border-radius: 9999px;
    background: rgba(0, 242, 255, 0.12);
}

@keyframes pulse-banner {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

/* ════════════════════════════════════════════════════════════════ */
/* ADD & DELETE BUTTONS */
/* ════════════════════════════════════════════════════════════════ */
.add-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
    flex-shrink: 0;
}

.add-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.add-btn.hidden {
    display: none !important;
}

.delete-about-btn,
.delete-category-btn,
.delete-exp-btn,
.delete-edu-btn,
.delete-project-btn,
.delete-stat-btn,
.delete-skill-btn,
.delete-project-skill-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.delete-about-btn,
.delete-category-btn,
.delete-exp-btn,
.delete-edu-btn,
.delete-project-btn,
.delete-stat-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.delete-about-btn:hover,
.delete-category-btn:hover,
.delete-exp-btn:hover,
.delete-edu-btn:hover,
.delete-project-btn:hover,
.delete-stat-btn:hover,
.delete-skill-btn:hover,
.delete-project-skill-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
}

.project-card .delete-project-btn {
    width: 30px !important;
    height: 30px !important;
    border-radius: 10px !important;
    top: -12px !important;
    right: -12px !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    background: rgba(14, 20, 28, 0.82) !important;
    color: #fca5a5 !important;
    box-shadow: none !important;
    backdrop-filter: blur(6px);
}

.project-card .delete-project-btn:hover {
    background: rgba(239, 68, 68, 0.22) !important;
    border-color: rgba(239, 68, 68, 0.65) !important;
    color: #fecaca !important;
    transform: translateY(-1px) scale(1.03) !important;
}

.project-banner-upload-btn {
    transition: all 0.2s ease;
}

.project-banner-upload-btn:hover {
    background: rgba(8, 12, 18, 0.8);
    border-color: rgba(34, 211, 238, 0.8);
}

/* ════════════════════════════════════════════════════════════════ */
/* SKILL IN CATEGORY BUTTONS */
/* ════════════════════════════════════════════════════════════════ */
.add-skill-in-category-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.add-skill-in-category-btn:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.add-skill-in-category-btn.hidden {
    display: none !important;
}

/* ════════════════════════════════════════════════════════════════ */
/* PROJECT SKILL ADD BUTTON */
/* ════════════════════════════════════════════════════════════════ */
.add-project-skill-direct-btn {
    padding: 0 !important;
    background: none !important;
    border: none !important;
    cursor: pointer;
    font-size: 12px !important;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.add-project-skill-direct-btn:hover {
    color: var(--accent) !important;
}

.add-project-skill-direct-btn.hidden {
    display: none !important;
}

/* ════════════════════════════════════════════════════════════════ */
/* MODAL STYLES */
/* ════════════════════════════════════════════════════════════════ */
#url-modal {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#url-modal.hidden {
    display: none !important;
}

#url-input {
    transition: all 0.2s ease;
}

#url-input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(0, 242, 255, 0.1);
}

/* ════════════════════════════════════════════════════════════════ */
/* LOADING STYLES */
/* ════════════════════════════════════════════════════════════════ */
.loader-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-card {
    background: linear-gradient(135deg, rgba(22, 27, 34, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
    padding: 32px 40px;
    border-radius: 16px;
    text-align: center;
    color: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 242, 255, 0.1);
    backdrop-filter: blur(10px);
}

.loader-card p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #e6edf3;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(0, 242, 255, 0.2);
    border-top: 2px solid #00f2ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ════════════════════════════════════════════════════════════════ */
/* SOCIAL LINKS */
/* ════════════════════════════════════════════════════════════════ */
.social-links {
    cursor: pointer;
}

.social-link {
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    transform: translateY(-2px);
}

/* ════════════════════════════════════════════════════════════════ */
/* SKILL MANAGEMENT */
/* ════════════════════════════════════════════════════════════════ */
.skill-category {
    position: relative;
}

.skills-list {
    min-height: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ════════════════════════════════════════════════════════════════ */
/* PROJECT SKILLS */
/* ════════════════════════════════════════════════════════════════ */
.project-skills-list {
    min-height: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.project-skill-item {
    transition: all 0.2s ease;
}

.project-skill-item:hover .delete-project-skill-btn {
    opacity: 1;
}

.project-skill-item .delete-project-skill-btn {
    opacity: 0;
    transition: all 0.2s ease;
}

.project-skill-item .delete-project-skill-btn:hover {
    transform: scale(1.1);
}

/* ════════════════════════════════════════════════════════════════ */
/* CARD HOVER STATES */
/* ════════════════════════════════════════════════════════════════ */
.exp-card,
.edu-card,
.stat-card {
    position: relative;
}

/* ════════════════════════════════════════════════════════════════ */
/* EDIT MODE FIELDS */
/* ════════════════════════════════════════════════════════════════ */
[contenteditable="true"] {
    min-height: 1.5em;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

[contenteditable="true"]:hover {
    background: rgba(0, 242, 255, 0.05);
    border-color: rgba(0, 242, 255, 0.2);
}

[contenteditable="true"]:focus {
    border-color: var(--accent);
    background: rgba(0, 242, 255, 0.1);
    outline: none;
}

/* ════════════════════════════════════════════════════════════════ */
/* RESPONSIVE ADJUSTMENTS */
/* ════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .owner-frame {
        padding-top: 42px;
    }

    .owner-toggle-anchor {
        right: 16px;
    }

    .owner-shell {
        border-radius: 12px;
        gap: 12px;
        padding: 10px;
    }

    .owner-right {
        width: 100%;
        justify-content: flex-start;
    }

    .owner-actions,
    .owner-session {
        width: 100%;
        justify-content: flex-start;
    }

    .owner-settings-menu {
        left: 0;
        right: auto;
        width: min(100%, 320px);
    }

    .toggle-btn,
    .save-btn,
    .share-btn,
    .discard-btn {
        padding: 8px 10px;
        font-size: 12px;
        min-width: fit-content;
    }

    .toggle-btn span,
    .save-btn span,
    .share-btn span,
    .discard-btn span {
        display: inline !important;
    }

    .add-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    #skills-container {
        grid-template-columns: 1fr !important;
    }

    .loader-card {
        padding: 24px 32px;
    }

    .spinner {
        width: 36px;
        height: 36px;
        border-width: 2px;
    }
}

@media (max-width: 640px) {
    .owner-shell {
        flex-direction: column;
        align-items: stretch;
    }

    .owner-frame {
        padding-top: 40px;
    }

    .owner-toggle-anchor {
        right: 12px;
    }

    .owner-studio-toggle-btn {
        padding: 5px 10px;
        font-size: 11px;
        max-width: calc(100vw - 32px);
    }

    .owner-left,
    .owner-right {
        width: 100%;
    }

    .owner-subtitle {
        font-size: 11px;
    }

    .owner-left,
    .owner-right {
        gap: 6px;
    }

    .owner-actions,
    .owner-session {
        flex-wrap: wrap;
    }

    .owner-settings-menu {
        width: 100%;
    }

    .toggle-btn,
    .save-btn,
    .share-btn,
    .discard-btn {
        padding: 6px 9px;
        font-size: 11px;
    }

    .loader-card {
        padding: 20px 24px;
    }

    .section-delete-btn {
        top: 10px;
        right: 10px;
        padding: 5px 8px;
        font-size: 10px;
    }
}

/* ════════════════════════════════════════════════════════════════ */
/* SMOOTH TRANSITIONS */
/* ════════════════════════════════════════════════════════════════ */
* {
    transition: color 0.2s ease, background-color 0.2s ease;
}

button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ════════════════════════════════════════════════════════════════ */
/* PADDING SYSTEM FOR OWNER BAR */
/* ════════════════════════════════════════════════════════════════ */
body {
    padding-top: 64px;
}

body.owner-visible {
    padding-top: 64px;
}

#owner-controls {
    position: sticky !important;
    top: 64px !important;
    left: 0 !important;
    right: 0 !important;
}

/* ════════════════════════════════════════════════════════════════ */
/* ANIMATIONS */
/* ════════════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ════════════════════════════════════════════════════════════════ */
/* CUSTOM BUTTON STYLING */
/* ════════════════════════════════════════════════════════════════ */
.button-container {
  display: inline-block;
  margin-bottom: 0.75rem;
}

.custom-btn-identity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  white-space: nowrap;
  cursor: pointer;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: #67e8f9;
  background-color: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 9999px;
  transition: all 0.3s ease;
  outline: none;
}

.custom-btn-identity:hover {
  background-color: rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.7);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
  transform: translateY(-1px);
}

.custom-btn-identity:active {
  transform: translateY(0);
  background-color: rgba(6, 182, 212, 0.3);
}
