/* ============================================================
   ICO Converter - Style Sheet
   Functional styling — aesthetics can be refined later.
   ============================================================ */

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
    line-height: 1.6;
    padding: 20px;
}

a {
    color: #60a5fa;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* === LAYOUT === */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 10px;
}

/* === CARDS === */
.card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* === HEADER === */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 0;
    border-bottom: 1px solid #334155;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f8fafc;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-email {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* === TYPOGRAPHY === */
h1, h2, h3 {
    color: #f1f5f9;
    margin-bottom: 12px;
}

h2 {
    font-size: 1.35rem;
}

h3 {
    font-size: 1.1rem;
    margin-top: 8px;
}

.subtitle {
    color: #94a3b8;
    font-size: 0.925rem;
    margin-bottom: 20px;
}

p {
    margin-bottom: 10px;
}

/* === LOGIN CARD === */
.login-card {
    text-align: center;
    max-width: 480px;
    margin: 60px auto;
}

.login-card h1 {
    font-size: 2rem;
    margin-bottom: 4px;
}

/* === FORMS === */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

label {
    font-size: 0.95rem;
    color: #cbd5e1;
    text-align: left;
}

input[type="email"],
input[type="file"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid #475569;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    transition: border-color 0.2s;
}

input[type="email"]:focus,
input[type="file"]:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

/* === FILE INPUT === */
.upload-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.file-input-wrapper {
    position: relative;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    top: 0;
    left: 0;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border: 2px dashed #475569;
    border-radius: 10px;
    background: #0f172a;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.file-label:hover {
    border-color: #60a5fa;
    background: #1a2744;
}

.file-icon {
    font-size: 1.5rem;
}

.file-text {
    font-size: 0.95rem;
    color: #94a3b8;
}

.form-info {
    font-size: 0.825rem;
    color: #64748b;
    margin-top: -8px;
}

/* === BUTTONS === */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: #3b82f6;
    color: #fff;
}

.btn-primary:hover {
    background: #2563eb;
    text-decoration: none;
}

.btn-secondary {
    background: #475569;
    color: #e2e8f0;
}

.btn-secondary:hover {
    background: #64748b;
    text-decoration: none;
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-full {
    width: 100%;
}

/* === MESSAGES === */
.message {
    padding: 14px 18px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 0.925rem;
    line-height: 1.5;
}

.message-success {
    background: #064e3b;
    border: 1px solid #059669;
    color: #a7f3d0;
}

.message-error {
    background: #4c0519;
    border: 1px solid #e11d48;
    color: #fecdd3;
}

/* === DEV LINK BOX === */
.dev-link-box {
    background: #1e3a5f;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    padding: 14px;
    margin-top: 12px;
    word-break: break-all;
}

.dev-link-box a {
    color: #93c5fd;
    font-weight: 600;
}

.dev-link-box code {
    background: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* === RESULT BOX === */
.result-box {
    background: #0f172a;
    border: 1px solid #065f46;
    border-radius: 10px;
    padding: 24px;
    margin-top: 20px;
    text-align: center;
}

.result-box h3 {
    color: #6ee7b7;
    margin-bottom: 8px;
}

/* === PREVIEW ICONS === */
.preview-area {
    margin: 20px 0;
}

.preview-icons {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.preview-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
}

.preview-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
}

/* === INFO TEXT === */
.info-text {
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 16px;
}

.small-note {
    color: #64748b;
    font-size: 0.8rem;
    margin-top: 8px;
}

/* === INSTRUCTIONS === */
.info-card ol {
    padding-left: 24px;
    margin-top: 8px;
}

.info-card li {
    margin-bottom: 8px;
    color: #cbd5e1;
}

.info-card code {
    background: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* === PREVIEW + ROTATE CONTROLS === */
.preview-rotate-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
}

.img-preview-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px;
    min-width: 100px;
    min-height: 100px;
}

.img-preview-wrapper img {
    max-width: 100%;
    height: auto;
    image-rendering: auto;
}

.rotate-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .card {
        padding: 20px;
    }

    .login-card {
        margin: 30px auto;
    }

    .header {
        flex-direction: column;
        gap: 10px;
    }

    .preview-icons {
        gap: 16px;
    }
}
