/* ===================================
   Demonfall Tier List Maker Styles
   Created: October 23, 2025
   Description: Professional drag & drop tier list creator
   =================================== */

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 20px 40px;
    color: white;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 30px;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    color: white;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 15px;
    opacity: 0.95;
    font-weight: 600;
}

.hero-description {
    font-size: 1.05rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 20px;
}

/* Action Toolbar */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
}

.toolbar .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 117, 125, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(23, 162, 184, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

/* Main Section */
.tier-maker-section {
    padding: 40px 20px;
    background: #f8f9fa;
}

/* Instructions */
.instructions {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.instructions h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.instructions ul {
    list-style: none;
    padding: 0;
}

.instructions li {
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 1rem;
    line-height: 1.6;
}

.instructions li:last-child {
    border-bottom: none;
}

.instructions strong {
    color: #667eea;
    font-weight: 600;
}

/* Tier List Canvas */
.tier-list-canvas {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12);
    margin-bottom: 30px;
}

.canvas-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #667eea;
}

.canvas-header h2 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 8px;
}

.canvas-credit {
    color: #718096;
    font-size: 0.9rem;
    font-style: italic;
}

/* Tier Categories */
.tier-categories {
    margin-bottom: 20px;
}

.tier-row {
    display: flex;
    margin-bottom: 15px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    min-height: 80px;
}

.tier-label {
    width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 900;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

.tier-label:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.tier-label:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.tier-text {
    pointer-events: none;
}

.tier-content {
    flex: 1;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px;
    gap: 10px;
    min-height: 80px;
    position: relative;
}

.tier-placeholder {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #adb5bd;
    font-style: italic;
    pointer-events: none;
    font-size: 0.9rem;
}

.tier-content:not(:empty) .tier-placeholder {
    display: none;
}

/* Tier Items */
.tier-item {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: grab;
    transition: all 0.3s ease;
    width: 100px;
    min-height: 90px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.tier-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.tier-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    transition: opacity 0.3s ease;
}

/* Hide broken images */
.tier-item img.img-error {
    display: none;
}

.tier-item span {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    color: #2d3748;
    line-height: 1.2;
    word-break: break-word;
    max-width: 100%;
}

/* When image fails, make text more prominent */
.tier-item.no-image {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-color: #667eea;
}

.tier-item.no-image span {
    font-size: 0.85rem;
    font-weight: 700;
    color: #667eea;
}

/* Sortable Ghost */
.sortable-ghost {
    opacity: 0.4;
    background: #667eea;
    border-color: #667eea;
}

.sortable-drag {
    opacity: 0.8;
    transform: rotate(5deg);
}

/* Items Pool Section */
.items-pool-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.items-pool-section h2 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.items-pool-section > p {
    color: #718096;
    margin-bottom: 20px;
    font-size: 1rem;
}

.items-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    min-height: 150px;
}

/* Share Section */
.share-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 30px;
}

.share-section h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.share-section > p {
    color: #718096;
    margin-bottom: 25px;
    font-size: 1rem;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.share-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.share-btn.twitter {
    background: linear-gradient(135deg, #1da1f2, #0d8bd9);
}

.share-btn.reddit {
    background: linear-gradient(135deg, #ff4500, #ff5700);
}

.share-btn.discord {
    background: linear-gradient(135deg, #7289da, #5b6eae);
}

.share-btn.copy {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.share-link-display {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.share-link-display input {
    flex: 1;
    max-width: 500px;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #f8f9fa;
}

.share-link-display .btn {
    padding: 12px 24px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Tips Section */
.tips-section {
    padding: 40px 20px;
    background: white;
}

.tips-section h2 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.tip-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.tip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.tip-card h3 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.tip-card p {
    color: #4a5568;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-style: italic;
}

/* Success/Error Messages */
.message {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

.message.success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.message.error {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.message.info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #adb5bd;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2rem;
    }

    .tier-label {
        width: 80px;
        font-size: 2rem;
    }

    .toolbar {
        gap: 8px;
    }

    .toolbar .btn {
        padding: 10px 18px;
        font-size: 0.85rem;
    }

    .tier-item {
        width: 90px;
        min-height: 85px;
    }

    .tier-item img {
        width: 50px;
        height: 50px;
    }

    .tier-item span {
        font-size: 0.7rem;
    }

    .tier-item.no-image span {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 40px 15px 30px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .toolbar .btn {
        width: 100%;
        max-width: 300px;
    }

    .tier-row {
        flex-direction: column;
        min-height: auto;
    }

    .tier-label {
        width: 100%;
        padding: 15px;
        font-size: 1.8rem;
    }

    .tier-content {
        min-height: 100px;
        justify-content: center;
    }

    .tier-item {
        width: 80px;
        min-height: 80px;
    }

    .tier-item img {
        width: 45px;
        height: 45px;
    }

    .tier-item span {
        font-size: 0.65rem;
    }

    .tier-item.no-image span {
        font-size: 0.75rem;
    }

    .items-pool {
        justify-content: center;
    }

    .share-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .share-btn {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .share-link-display {
        flex-direction: column;
    }

    .share-link-display input {
        width: 100%;
        max-width: 100%;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }

    .message {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-description {
        font-size: 0.9rem;
    }

    .instructions,
    .tier-list-canvas,
    .items-pool-section,
    .share-section {
        padding: 20px;
    }

    .tier-item {
        width: 70px;
        min-height: 75px;
    }

    .tier-item img {
        width: 40px;
        height: 40px;
    }

    .tier-item span {
        font-size: 0.6rem;
    }

    .tier-item.no-image span {
        font-size: 0.7rem;
    }

    .canvas-header h2 {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .toolbar,
    .instructions,
    .items-pool-section,
    .share-section,
    .tips-section,
    .main-nav,
    .breadcrumb,
    .site-footer,
    .back-to-top {
        display: none !important;
    }

    .tier-list-canvas {
        box-shadow: none;
        page-break-inside: avoid;
    }

    .tier-row {
        page-break-inside: avoid;
    }
}

/* Accessibility */
.tier-label:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Animation for first load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tier-row {
    animation: fadeInUp 0.5s ease backwards;
}

.tier-row:nth-child(1) { animation-delay: 0.1s; }
.tier-row:nth-child(2) { animation-delay: 0.2s; }
.tier-row:nth-child(3) { animation-delay: 0.3s; }
.tier-row:nth-child(4) { animation-delay: 0.4s; }
.tier-row:nth-child(5) { animation-delay: 0.5s; }

