/* Additional Styles for Twibbon Clone */

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f4f7f6;
}

main {
    flex: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.header h1 {
    margin: 0;
    font-size: 2.2rem;
}

.header h1 a {
    color: white;
    text-decoration: none;
}

.header p {
    margin: 10px 0 0 0;
    font-size: 1rem;
    opacity: 0.9;
}

/* Add Frame Button in Header */
.header-actions {
    margin-top: 15px;
}

.frame-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.frame-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.frame-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.frame-card img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
    height: auto;
    background: #f8f9fa;
}

.frame-card h3 {
    margin: 15px 0;
    color: #333;
    font-size: 1.2rem;
}

.frame-card a {
    text-decoration: none;
    color: inherit;
}

.card-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.85rem;
}

#canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

canvas {
    max-width: 100%;
    height: auto !important;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: move;
    touch-action: none; /* Crucial for custom touch handling */
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 25px 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.btn-secondary {
    background: #fff;
    color: #444;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #ccc;
    color: #000;
}

.btn-edit {
    background: #ffc107;
    color: #000;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.footer {
    text-align: center;
    padding: 40px 20px;
    color: #777;
    background: #fff;
    border-top: 1px solid #eee;
    margin-top: 50px;
}

/* Spacing Helpers */
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 { font-size: 1.8rem; }
    .main-layout { flex-direction: column; }
    .ad-sidebar { display: none; }
    .controls { gap: 8px; }
    .btn { width: 100%; padding: 14px; }
}

/* Advertisement Slots */
.ad-slot {
    background: #f0f0f0;
    border: 1px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin: 20px 0;
}

.ad-slot-top, .ad-slot-bottom {
    width: 100%;
    height: 120px;
}

.ad-slot-sidebar {
    width: 300px;
    height: 300px;
}

.ad-placeholder {
    color: #aaa;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Controls Info */
.controls-info {
    background: #eef2ff;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #444;
    text-align: center;
}

.controls-info p { margin: 0; }
.controls-info strong { color: #667eea; }
