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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Typography */
h1, h2, h3 {
    margin-bottom: 0.5em;
    color: #2c3e50;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 0.5em;
}

h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.3em;
    margin-bottom: 1em;
}

h3 {
    font-size: 1.3rem;
}

p {
    margin-bottom: 1em;
}

/* Layout */
header {
    text-align: center;
    margin-bottom: 2em;
    padding: 1em;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

section {
    background-color: white;
    border-radius: 8px;
    padding: 2em;
    margin-bottom: 2em;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

footer {
    text-align: center;
    padding: 1em;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Upload section */
.upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2em;
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    background-color: #ecf0f1;
    transition: all 0.3s ease;
}

.upload-container:hover {
    border-color: #3498db;
    background-color: #e8f4fc;
}

#image-upload {
    display: none;
}

.upload-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #3498db;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-bottom: 1em;
    text-align: center;
}

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

.upload-info {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Preview section */
.hidden {
    display: none;
}

.platforms-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.platform-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1em;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.platform-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.preview-container {
    width: 100%;
    margin-bottom: 1em;
    position: relative;
    overflow: hidden;
}

.preview-frame {
    width: 100%;
    position: relative;
    overflow: hidden;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

.platform-info {
    width: 100%;
    text-align: center;
    margin-bottom: 1em;
    font-size: 0.9rem;
}

.safe-zone {
    color: #e74c3c;
    font-style: italic;
    cursor: pointer;
    text-decoration: underline;
}

.download-button {
    padding: 8px 16px;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

.download-button:hover {
    background-color: #27ae60;
}

/* Instructions section */
#instructions {
    margin-top: 2em;
}

#instructions ol {
    margin-left: 1.5em;
    margin-bottom: 2em;
}

#instructions li {
    margin-bottom: 0.5em;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}

table th, table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

table tr:hover {
    background-color: #f5f5f5;
}

/* Preview aspect ratio containers */
[data-platform="x"] .preview-frame {
    padding-bottom: 33.33%; /* 3:1 aspect ratio */
}

[data-platform="youtube"] .preview-frame {
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

[data-platform="facebook"] .preview-frame {
    padding-bottom: 37%; /* 2.7:1 aspect ratio */
}

[data-platform="linkedin"] .preview-frame {
    padding-bottom: 16.93%; /* 5.9:1 aspect ratio */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .platforms-container {
        grid-template-columns: 1fr;
    }
    
    section {
        padding: 1em;
    }
    
    table {
        font-size: 0.9rem;
    }
}

/* Dragover state for upload container */
.upload-container.dragover {
    border-color: #2ecc71;
    background-color: #e8f8f5;
}