/* Font face declaration */
@font-face {
    font-family: 'Halogen';
    src: url('fonts/Halogen_0.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Halogen';
}

body {
    font-family: 'Halogen';
    background: linear-gradient(135deg, #ffb3de 0%, #ff9999 100%);
    background-attachment: fixed;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* Header styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

/* Tab navigation */
.nav-tabs {
    display: flex;
    gap: 10px;
}

.tab-btn {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-family: 'Halogen';
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.tab-btn:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.tab-btn.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
    cursor: default;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Halogen';
    font-weight: bold;
}

h1 {
    color: #d63384;
    font-size: 2.5em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.upload-section {
    position: relative;
}

.upload-button, .icon-upload-button {
    background-color: #3498db;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-family: 'Halogen';
    transition: background-color 0.3s ease;
    display: inline-block;
}

.upload-button:hover, .icon-upload-button:hover {
    background-color: #2980b9;
}

input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0.1px;
    height: 0.1px;
    overflow: hidden;
}

/* Workspace layout */
.workspace {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.canvas-container {
    flex: 1;
    position: relative;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#main-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    cursor: crosshair;
}

#canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Icon panel styles */
.icon-panel {
    width: 300px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.icon-panel h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.4em;
    font-weight: 400;
}

/* Badge Panel Styles */
.badge-item {
    margin: 10px 0;
    text-align: center;
}

.badge-thumb {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: white;
}

.badge-thumb:hover {
    border-color: #ff69b4;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.3);
}

/* Badge selection highlighting */
.badge-thumb.badge-selected {
    border: 3px solid #ff69b4;
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.6);
    transform: scale(1.1);
}

/* Add sticker button styling */
.add-sticker-btn {
    transition: all 0.3s ease;
}

.add-sticker-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
}

.add-sticker-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.badge-placeholder {
    width: 80px;
    height: 80px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    margin: 0 auto;
}

.placeholder-icon {
    font-size: 20px;
}

.no-badges {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

.error-message {
    text-align: center;
    color: #dc3545;
    padding: 20px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
}

/* Controls styles */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
}

.controls button {
    background-color: #ecf0f1;
    color: #2c3e50;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-family: 'Halogen';
    transition: all 0.3s ease;
}

.controls button:hover {
    background-color: #d5dbdb;
    transform: translateY(-2px);
}

#download-canvas {
    background-color: #27ae60;
    color: white;
}

#download-canvas:hover {
    background-color: #229954;
}

/* Modal styles */
.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(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 95%;
    max-width: 900px;
    max-height: 75vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn {
    background-color: #ff69b4;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    font-family: 'Halogen';
    font-weight: bold;
    transition: all 0.3s ease;
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-btn:hover {
    background-color: #ff1493;
    transform: scale(1.1);
}

.modal-content h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.8em;
    font-family: 'Halogen';
}

.share-btn {
    background-color: #1DA1F2;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-family: 'Halogen';
    margin: 10px;
    transition: background-color 0.3s ease;
}

.share-btn:hover {
    background-color: #1991db;
}

.preview-image {
    margin: 20px 0;
    text-align: center;
}

.preview-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Want a PFP Modal - Enhanced Text Styling */
.want-pfp-content {
    max-width: 900px;
    max-height: 70vh;
    overflow-y: auto;
    width: 95%;
}

.want-pfp-content h2 {
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.want-pfp-text {
    text-align: left;
    margin-bottom: 20px;
    line-height: 1.6;
}

.gprove-title {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    color: #e74c3c;
    text-shadow: 0 1px 3px rgba(231, 76, 60, 0.3);
    letter-spacing: 1px;
}

.main-instruction {
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1.5;
}

.steps-list {
    margin: 25px 0;
    padding-left: 0;
    list-style: none;
    counter-reset: step-counter;
}

.steps-list li {
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: bold;
    color: #34495e;
    display: flex;
    align-items: flex-start;
    line-height: 1.4;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.steps-list li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 50%;
    margin-right: 15px;
    min-width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
    flex-shrink: 0;
}

.staking-link {
    font-size: 22px;
    margin: 30px 0;
    text-align: center;
    font-weight: bold;
    color: #2c3e50;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.staking-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
    font-size: 22px;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.1);
}

.staking-link a:hover {
    text-decoration: none;
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* POST Button Styles */
.post-button-container {
    text-align: center;
    margin-top: 20px;
}

.post-btn {
    background-color: #ff69b4;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-family: 'Halogen';
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
}

.post-btn:hover {
    background-color: #ff1493;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.4);
}

.post-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 105, 180, 0.3);
}

/* Banner Image */
.banner-image {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: rgba(248, 249, 250, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.banner-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.banner-placeholder {
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    color: #6c757d;
}

/* PFP Library styles */
.library-container {
    padding: 20px 0;
}

.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.library-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.8em;
    font-weight: 400;
    font-family: 'Halogen';
}

.library-description {
    margin: 0;
    color: #6c757d;
}

.pixnvm-link {
    color: #1DA1F2;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

.pixnvm-link:hover {
    color: #1991db;
    text-decoration: underline;
}

.pfpix-gang-link {
    color: #ff69b4;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

.pfpix-gang-link:hover {
    color: #ff1493;
    text-decoration: underline;
}

.want-pfp-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-family: 'Halogen';
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.want-pfp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.pfp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
    min-height: 400px;
    overflow: visible;
}

.pfp-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: visible;
}

.pfp-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.pfp-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.pfp-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.pfp-id {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    display: inline-block;
}

.preview-btn, .download-pfp-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Halogen';
    transition: background-color 0.3s ease;
}

.preview-btn {
    background-color: #667eea;
    color: white;
}

.preview-btn:hover {
    background-color: #5a6fd8;
}

.download-pfp-btn {
    background-color: #27ae60;
    color: white;
}

.download-pfp-btn:hover {
    background-color: #229954;
}

/* PFP Preview Modal */
.pfp-preview-content {
    max-width: 600px;
}

#pfp-preview-image {
    margin: 20px 0;
    text-align: center;
}

.pfp-preview-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.download-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-family: 'Halogen';
    transition: background-color 0.3s ease;
}

.download-btn:hover {
    background-color: #229954;
}

/* Badges Header and Help Icon */
.badges-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.badges-header h3 {
    margin: 0;
}

.help-icon {
    width: 20px;
    height: 20px;
    background: #ff78b3;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.help-icon:hover {
    background: #ff69b4;
    transform: scale(1.1);
}

.help-icon:active {
    transform: scale(0.95);
}

/* Help Modal Styles */
.help-content {
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}



.help-sections {
    margin: 20px 0;
}

.help-section {
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border-left: 4px solid #ff78b3;
}

.help-section h3 {
    margin: 0 0 10px 0;
    color: #ff78b3;
    font-size: 16px;
}

.help-section p {
    margin: 0;
    color: #2c3e50;
    line-height: 1.5;
}

/* Sticker Selection Panel */
.sticker-selection {
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 2px solid #ff78b3;
}

.sticker-selection h4 {
    margin: 0 0 10px 0;
    color: #ff78b3;
    font-size: 14px;
    text-align: center;
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.sticker-option {
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #ff78b3;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    margin: 0 auto;
}

.sticker-option:hover {
    background: #ff78b3;
    transform: scale(1.1);
}

.sticker-option.selected {
    background: #ff78b3;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 120, 179, 0.4);
}

.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    color: #666;
    font-size: 12px;
    padding: 20px;
}

.sticker-option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}



/* Modal and Close Button Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    height: 70vh;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #ff78b3;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #ff69b4;
    transform: scale(1.1);
}

/* Workspace and Icon Panel Styles */
.workspace {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.canvas-container {
    flex: 1;
    position: relative;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#main-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    /* Debug: make sure canvas is clickable */
    position: relative;
    z-index: 10;
    cursor: crosshair;
}

.icon-panel {
    width: 300px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-height: 600px;
    overflow-y: auto;
}

.badges-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.badges-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.help-icon {
    width: 24px;
    height: 24px;
    background: #ff78b3;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    user-select: none;
    /* Debug styling to ensure visibility */
    border: 2px solid #ff1493;
    box-shadow: 0 0 10px rgba(255, 20, 147, 0.8);
    z-index: 100;
}

.help-icon:hover {
    background: #ff69b4;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(255, 120, 179, 0.4);
}

/* Help Modal Content Styles */
.help-content {
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
}

.help-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.help-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #ff78b3;
}

.help-section h3 {
    color: #ff78b3;
    margin-bottom: 10px;
    font-size: 18px;
}

.help-section p {
    margin: 8px 0;
    line-height: 1.6;
    color: #333;
}

.help-section strong {
    color: #ff78b3;
}

/* Responsive design */
@media (max-width: 768px) {
    .workspace {
        flex-direction: column;
    }

    .icon-panel {
        width: 100%;
    }

    h1 {
        font-size: 2em;
    }

    header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}
